Package com.oss.storage
Class OSSCharStorage
java.lang.Object
com.oss.storage.OSSFileStorage
com.oss.storage.OSSCharStorage
- All Implemented Interfaces:
CharStorage
,Storage
,Serializable
,Cloneable
Implements external storage for the data whose contents is either an
array of characters or a String.
- Since:
- ASN.1/Java 1.4-beta A
- See Also:
-
Constructor Summary
ConstructorDescriptionThe default constructor.OSSCharStorage
(File file) Create an OSSCharStorage object and associate it with an existing disk file. -
Method Summary
Methods inherited from class com.oss.storage.OSSFileStorage
canRead, canWrite, clone, copy, deallocate, getSize, reset, toString
-
Constructor Details
-
OSSCharStorage
public OSSCharStorage()The default constructor. Bypasses to the default constructor of the superclass that creates a temporary file and associates the file with this storage object. -
OSSCharStorage
Create an OSSCharStorage object and associate it with an existing disk file.- Parameters:
file
- disk file to associate with this storage object.- Throws:
StorageException
- if the specified file does not exist or is not an ordinary (normal) file.
-
-
Method Details
-
getKind
public int getKind()Identify the kind of storage this object implements. -
getReader
Return a Reader to read the contents of the storage.- Specified by:
getReader
in interfaceCharStorage
- Returns:
- a Reader.
- Throws:
StorageException
- if read access to the contents was denied.
-
getWriter
Return a Writer to modify the contents of the storage.- Specified by:
getWriter
in interfaceCharStorage
- Parameters:
append
-false
if the new data will overwrite the value,true
when the new data will append to the current contents.- Returns:
- a Writer.
- Throws:
StorageException
- if write access to the contents was denied.
-