org.xiruss.repository.api
Interface StorageObjectData

All Known Implementing Classes:
FileStorageObjectData, InMemoryStorageObjectData, StorageObjectDataBase

public interface StorageObjectData

Interface for system-specific objects that hold or enable access to the data for a storage object, e.g., a File object. The data is always managed as bytes, not characters.


Method Summary
 void close()
          Closes any open output streams.
 byte[] getBytes()
          Gets all the bytes of the storage object.
 java.io.InputStream getInputStream()
          Gets an input stream from which the storage object data bytes can be read.
 java.io.OutputStream getOutputStream()
          Returns an exclusive output stream to which new data can be written.
 StorageObject getStorageObject()
           
 boolean isOpen()
          Returns true if the data object is open for writing.
 long size()
          Returns the number of bytes in the storage object.
 

Method Detail

size

long size()
Returns the number of bytes in the storage object.

Returns:

getOutputStream

java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Returns an exclusive output stream to which new data can be written.

Returns:
Throws:
java.io.IOException

close

void close()
           throws java.io.IOException
Closes any open output streams.

Throws:
java.io.IOException

getInputStream

java.io.InputStream getInputStream()
                                   throws java.io.IOException
Gets an input stream from which the storage object data bytes can be read.

Returns:
ByteArrayInputStream
Throws:
java.io.IOException

getBytes

byte[] getBytes()
                throws java.io.IOException
Gets all the bytes of the storage object.

Returns:
Throws:
java.io.IOException

isOpen

boolean isOpen()
Returns true if the data object is open for writing.

Returns:

getStorageObject

StorageObject getStorageObject()