org.garret.perst
Interface Blob

All Superinterfaces:
java.io.Externalizable, IPersistent, IResource, java.io.Serializable

public interface Blob
extends IPersistent, IResource

Interface to store/fetch large binary objects


Method Summary
 java.io.InputStream getInputStream()
          Get input stream.
 java.io.OutputStream getOutputStream()
          Get output stream to append data to the BLOB.
 java.io.OutputStream getOutputStream(boolean multisession)
          Get output stream to append data to the BLOB.
 java.io.OutputStream getOutputStream(long position, boolean multisession)
          Get output stream with specified current postion in BLOB.
 
Methods inherited from interface org.garret.perst.IPersistent
assignOid, deallocate, getOid, getStorage, invalidate, isDeleted, isModified, isPersistent, isRaw, load, loadAndModify, makePersistent, modify, onLoad, onStore, recursiveLoading, store
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 
Methods inherited from interface org.garret.perst.IResource
exclusiveLock, exclusiveLock, reset, sharedLock, sharedLock, unlock
 

Method Detail

getInputStream

public java.io.InputStream getInputStream()
Get input stream. InputStream.availabe method can be used to get BLOB size

Returns:
input stream with BLOB data

getOutputStream

public java.io.OutputStream getOutputStream()
Get output stream to append data to the BLOB.

Returns:
output srteam

getOutputStream

public java.io.OutputStream getOutputStream(boolean multisession)
Get output stream to append data to the BLOB.

Parameters:
multisession - whether BLOB allows further appends of data or closing this output streat means that BLOB will not be changed any more.
Returns:
output srteam

getOutputStream

public java.io.OutputStream getOutputStream(long position,
                                            boolean multisession)
Get output stream with specified current postion in BLOB.

Parameters:
position - current position in BLOB, if less than zero, than data will be appended to the BLOB
multisession - whether BLOB allows further appends of data or closing this output streat means that BLOB will not be changed any more.
Returns:
output srteam