Package com.oss.asn1

Interface CharStorage

All Superinterfaces:
Serializable, Storage
All Known Implementing Classes:
OSSCharStorage

public interface CharStorage extends Storage
The CharStorage interface extends the Storage interface to include additional methods for accessing and modifying the contents, that is an array of characters.
Since:
ASN.1/Java 1.4 beta A
  • Method Details

    • getReader

      Reader getReader() throws StorageException
      Get the Reader to read individual characters from the the storage. Your implementation is responsible for preventing concurrent read and write accesses to the contents. When the read access is not permitted for some reason (say, when the canRead() returns false), a StorageException is thrown.

      If this object implements indefinite length storage (which occurs when getSize() returns -1) the returned Reader's content is expected to be available in multiple contiguous segments. The segment boundaries are indicated by reader.ready() returning false. The reader.ready() method returns false for a second consecutive time when the end is reached. That means that a return code of false followed by a return code of true indicates the beginning of a new segment, but a return code of false followed by another return code of false indicates the end.

      Returns:
      the instance of Reader to read the contents of the storage.
      Throws:
      StorageException - if the contents of the storage is not readable.
    • getWriter

      Writer getWriter(boolean append) throws StorageException
      Get the Writer to modify the contents of the storage. Your implementation is responsible for preventing concurrent read and write accesses to the contents. When the append parameter is false, the current contents of the storage is reset. Otherwise, the characters that are written to the Writer, are appended at the end of the existing value. If write access is not permitted for some reason (say, when canWrite() returns false), a StorageException is thrown.
      Parameters:
      append - false when overwriting the existing value, true when appending to the existing value.
      Returns:
      the instance of the Writer to write the contents of the storage.
      Throws:
      StorageException - if the contents of the storage is not writable.