Package com.oss.storage
Class OSSObjectStorage
java.lang.Object
com.oss.storage.OSSFileStorage
com.oss.storage.OSSObjectStorage
- All Implemented Interfaces:
ObjectStorage
,Storage
,Serializable
,Cloneable
Implements external storage for the data whose contents is an array
of Objects.
- Since:
- ASN.1/Java 1.4-beta A
- See Also:
-
Constructor Summary
ConstructorDescriptionThe default constructor.OSSObjectStorage
(File file) Create an OSSObjectStorage 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
-
OSSObjectStorage
public OSSObjectStorage()The default constructor. Bypasses to the default constructor of the superclass, that creates a temporary file and associates the file with this storage object. -
OSSObjectStorage
Create an OSSObjectStorage 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 an ObjectReader to read the contents of the storage.- Specified by:
getReader
in interfaceObjectStorage
- Returns:
- an ObjectReader.
- Throws:
StorageException
- if read access to the contents was denied.
-
getWriter
Return an ObjectWriter to modify the contents of the storage. This implementation of the ObjectStorage does not support the append operation. If theappend
parameter istrue
a StorageException is thrown.- Specified by:
getWriter
in interfaceObjectStorage
- Parameters:
append
- this parameter must be set tofalse
.- Returns:
- an ObjectWriter.
- Throws:
StorageException
- if write access to the contents was denied or append mode has been requested by the caller.
-