Package com.oss.storage
Class OSSFileStorage
java.lang.Object
com.oss.storage.OSSFileStorage
- All Implemented Interfaces:
Storage
,Serializable
,Cloneable
- Direct Known Subclasses:
OSSByteStorage
,OSSCharStorage
,OSSObjectStorage
The OSSFileStorage class is the common superclass for the
OSSByteStorage, OSSCharStorage and OSSObjectStorage.
- Since:
- ASN.1/Java 1.4-beta A
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canRead()
Indicate if this storage object is readable.boolean
canWrite()
Indicate if this storage object is writable.clone()
Implements deep copy.copy()
Create another storage object with identical contents.void
Destroy the storage object and delete associated disk file.long
getSize()
Return the number of data items (bytes, characters or objects), contained in this storage object.void
reset
(boolean zeroize) Discard current contents of the storage object.toString()
Return a string representation of this object.
-
Method Details
-
getSize
public long getSize()Return the number of data items (bytes, characters or objects), contained in this storage object. -
reset
Discard current contents of the storage object. After the call to this method the storage object becomes empty and thegetSize()
method will return 0. Unlike thedeallocate()
method, thereset()
does not release external resources, used by this storage object. For example, if the contents is stored in the disk file, the file is reset to zero length but is not deleted.- Specified by:
reset
in interfaceStorage
- Parameters:
zeroize
-true
indicates that the contents should be cleared by setting the contents to all zeroes before resetting the storage.- Throws:
StorageException
- if any error occurs when resetting the contents of the storage.
-
deallocate
Destroy the storage object and delete associated disk file.- Specified by:
deallocate
in interfaceStorage
- Throws:
StorageException
- if any error occurs when destroying the storage object.
-
copy
Create another storage object with identical contents.- Specified by:
copy
in interfaceStorage
- Returns:
- a copy of this storage object.
- Throws:
StorageException
- if the copy operation fails.
-
clone
Implements deep copy.- Throws:
CloneNotSupportedException
-
toString
Return a string representation of this object. The string returned specifies the file name of the associated File object. -
canRead
public boolean canRead()Indicate if this storage object is readable. -
canWrite
public boolean canWrite()Indicate if this storage object is writable.
-