Package com.oss.asn1
Interface ObjectStorage<T>
- Type Parameters:
T
- type of objects in this object storage.
- All Superinterfaces:
Serializable
,Storage
- All Known Implementing Classes:
OSSObjectStorage
The
ObjectStorage
interface extends the Storage
interface to include additional methods for accessing and modifying the
contents, that is an array of Objects.- Since:
- ASN.1/Java 1.4 beta A
-
Method Summary
Modifier and TypeMethodDescriptionGet theObjectReader
to read individual objects from the the storage.getWriter
(boolean append) Get theObjectWriter
to modify the contents of the storage.
-
Method Details
-
getReader
Get theObjectReader
to read individual objects 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 thecanRead()
returnsfalse
), a StorageException is thrown.- Returns:
- the instance of
ObjectReader
to read the contents of the storage. - Throws:
StorageException
- if the contents of the storage is not readable.
-
getWriter
Get theObjectWriter
to modify the contents of the storage. Your implementation is responsible for preventing concurrent read and write accesses to the contents. When theappend
parameter isfalse
, the current contents of the storage is reset. Otherwise, the objects that are written to theObjectWriter
, are appended at the end of the existing value. If the write access is not permitted for some reason (say, when thecanWrite()
returnsfalse
), a StorageException is thrown.- Parameters:
append
-false
when overwriting the existing value,true
when appending to the existing value.- Returns:
- the instance of the
ObjectWriter
to write the contents of the storage. - Throws:
StorageException
- if the contents of the storage is not writable.
-