Class OSSCharStorage

java.lang.Object
com.oss.storage.OSSFileStorage
com.oss.storage.OSSCharStorage
All Implemented Interfaces:
CharStorage, Storage, Serializable, Cloneable

public class OSSCharStorage extends OSSFileStorage implements CharStorage
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 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

      public OSSCharStorage(File file)
      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.
      Specified by:
      getKind in interface Storage
      Returns:
      StorageManager.STORAGE_CHARS.
    • getReader

      public Reader getReader() throws StorageException
      Return a Reader to read the contents of the storage.
      Specified by:
      getReader in interface CharStorage
      Returns:
      a Reader.
      Throws:
      StorageException - if read access to the contents was denied.
    • getWriter

      public Writer getWriter(boolean append) throws StorageException
      Return a Writer to modify the contents of the storage.
      Specified by:
      getWriter in interface CharStorage
      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.