org.ozoneDB.blob
Class BLOBContainerImpl
java.lang.Object
org.ozoneDB.OzoneObject
org.ozoneDB.blob.BLOBContainerImpl
- All Implemented Interfaces:
- BLOBContainer, org.ozoneDB.OzoneCompatible, org.ozoneDB.OzoneCompatibleOrProxy, org.ozoneDB.OzoneRemote, java.io.Serializable
- public class BLOBContainerImpl
- extends org.ozoneDB.OzoneObject
- implements BLOBContainer
The BLOB implementation. The data are stored in several BLOBPages. The
data of the BLOB can be accessed through BLOBInOutputStreams.
- Version:
- $Revision: 1.4 $Date: 2003/04/11 14:47:40 $
- Author:
- SMB
- See Also:
- Serialized Form
Method Summary |
int |
available(int _index)
Returns the available bytes of this BLOB beginning at index.
|
void |
init(int _pageSize)
|
void |
onDelete()
This method must be called to kill all referenced BLOBpages.
|
protected int |
pageNum(int index)
|
protected int |
pageOff(int index)
|
byte[] |
read(int index,
int len)
|
void |
write(int _index,
byte[] b,
int off,
int len)
Writes the content of the Array into the BLOB starting at index. |
Methods inherited from class org.ozoneDB.OzoneObject |
container, database, deleteRecursive, equals, getHandle, getObjectID, handle, hashCode, onActivate, onCreate, onPassivate, requireWriteLocking, self, setContainer, toString, toXML |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.ozoneDB.OzoneCompatibleOrProxy |
getObjectID |
DEFAULT_PAGE_SIZE
protected static final int DEFAULT_PAGE_SIZE
- See Also:
- Constant Field Values
debug
protected boolean debug
pages
protected org.ozoneDB.DxLib.DxVector pages
pageSize
protected int pageSize
BLOBContainerImpl
public BLOBContainerImpl()
init
public void init(int _pageSize)
- Specified by:
init
in interface BLOBContainer
available
public int available(int _index)
throws java.lang.Exception
- Returns the available bytes of this BLOB beginning at index.
NEVER WRITE ON BLOB WHILE EXECUTING THIS METHOD!
- Specified by:
available
in interface BLOBContainer
- Parameters:
_index
- the startposition
- Returns:
- the number of available bytes after _index
- Throws:
java.lang.Exception
- (some kind of databaseexception ?)
write
public void write(int _index,
byte[] b,
int off,
int len)
throws java.lang.Exception
- Writes the content of the Array into the BLOB starting at index.
- Specified by:
write
in interface BLOBContainer
- Parameters:
_index
- the write startposition in the BLOBb
- the bytearray to be storedoff
- the startindex in the bytearraylen
- the number of bytes to be written into the BLOB
- Throws:
java.lang.Exception
read
public byte[] read(int index,
int len)
throws java.lang.Exception
- Specified by:
read
in interface BLOBContainer
- Throws:
java.lang.Exception
onDelete
public void onDelete()
- This method must be called to kill all referenced BLOBpages.
(hope the database does this for me...)
- Specified by:
onDelete
in interface org.ozoneDB.OzoneCompatible
pageNum
protected int pageNum(int index)
pageOff
protected int pageOff(int index)
Copyright © 2004 The Ozone Database Project - www.ozone-db.org. All Rights Reserved.