Package com.db4o.internal
Class ByteArrayBuffer
- java.lang.Object
- 
- com.db4o.internal.ByteArrayBuffer
 
- 
- All Implemented Interfaces:
- ReadWriteBuffer,- ReadBuffer,- WriteBuffer
 - Direct Known Subclasses:
- StatefulBuffer
 
 public class ByteArrayBuffer extends java.lang.Object implements ReadWriteBuffer 
- 
- 
Constructor SummaryConstructors Constructor Description ByteArrayBuffer(byte[] buffer)ByteArrayBuffer(int length)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(byte[] bytes)protected booleancanWritePersistentBase()booleancheckXBytes()voidcheckXBytes(boolean flag)booleancontainsTheSame(ByteArrayBuffer other)voidcopyTo(ByteArrayBuffer to, int fromOffset, int toOffset, int length)voidensureSize(int size)booleaneof()voidincrementIntSize()voidincrementOffset(int a_by)intlength()intoffset()returns the current offset in the buffervoidread(ObjectContainerBase stream, int address, int addressOffset)non-encrypted read, used for indexesvoidreadBegin(byte identifier)BitMap4readBitMap(int bitCount)bytereadByte()reads a byte from the buffer.voidreadBytes(byte[] bytes)reads an array of bytes from the buffer.byte[]readBytes(int a_length)ByteArrayBufferreadEmbeddedObject(Transaction trans)voidreadEncrypt(ObjectContainerBase stream, int address)voidreadEnd()intreadInt()reads an int from the buffer.longreadLong()reads a long from the buffer.ByteArrayBufferreadPayloadReader(int offset, int length)intremainingByteCount()voidseek(int offset)positions the read pointer at the specified positionvoidskip(int length)java.lang.StringtoString()voidwriteBegin(byte a_identifier)voidwriteBitMap(BitMap4 nullBitMap)voidwriteByte(byte a_byte)writes a single byte to the buffer.voidwriteBytes(byte[] bytes)writes an array of bytes to the buffervoidwriteEnd()voidwriteIDOf(Transaction trans, PersistentBase persistent)voidwriteIDOf(Transaction trans, java.lang.Object obj)voidwriteInt(int a_int)writes an int to the buffer.voidwriteLong(long l)writes a long to the buffervoidwriteShortString(Transaction trans, java.lang.String a_string)
 
- 
- 
- 
Method Detail- 
seekpublic void seek(int offset) Description copied from interface:ReadBufferpositions the read pointer at the specified position- Specified by:
- seekin interface- ReadBuffer
- Parameters:
- offset- the desired position in the buffer
 
 - 
writeBytespublic void writeBytes(byte[] bytes) Description copied from interface:WriteBufferwrites an array of bytes to the buffer- Specified by:
- writeBytesin interface- WriteBuffer
- Parameters:
- bytes- the byte array
 
 - 
appendpublic void append(byte[] bytes) 
 - 
containsTheSamepublic final boolean containsTheSame(ByteArrayBuffer other) 
 - 
copyTopublic void copyTo(ByteArrayBuffer to, int fromOffset, int toOffset, int length) 
 - 
lengthpublic int length() - Specified by:
- lengthin interface- ReadWriteBuffer
 
 - 
incrementOffsetpublic void incrementOffset(int a_by) - Specified by:
- incrementOffsetin interface- ReadWriteBuffer
 
 - 
readpublic void read(ObjectContainerBase stream, int address, int addressOffset) non-encrypted read, used for indexes
 - 
readBeginpublic final void readBegin(byte identifier) - Specified by:
- readBeginin interface- ReadWriteBuffer
 
 - 
readBitMappublic BitMap4 readBitMap(int bitCount) - Specified by:
- readBitMapin interface- ReadBuffer
 
 - 
readBytepublic byte readByte() Description copied from interface:ReadBufferreads a byte from the buffer.- Specified by:
- readBytein interface- ReadBuffer
- Returns:
- the byte
 
 - 
readBytespublic byte[] readBytes(int a_length) 
 - 
readBytespublic void readBytes(byte[] bytes) Description copied from interface:ReadBufferreads an array of bytes from the buffer. The length of the array that is passed as a parameter specifies the number of bytes that are to be read. The passed bytes buffer parameter is directly filled.- Specified by:
- readBytesin interface- ReadBuffer
- Parameters:
- bytes- the byte array to read the bytes into.
 
 - 
readEmbeddedObjectpublic final ByteArrayBuffer readEmbeddedObject(Transaction trans) throws Db4oIOException - Throws:
- Db4oIOException
 
 - 
readEncryptpublic void readEncrypt(ObjectContainerBase stream, int address) throws Db4oIOException - Throws:
- Db4oIOException
 
 - 
readEndpublic void readEnd() - Specified by:
- readEndin interface- ReadWriteBuffer
 
 - 
readIntpublic final int readInt() Description copied from interface:ReadBufferreads an int from the buffer.- Specified by:
- readIntin interface- ReadBuffer
- Returns:
- the int
 
 - 
readLongpublic long readLong() Description copied from interface:ReadBufferreads a long from the buffer.- Specified by:
- readLongin interface- ReadBuffer
- Returns:
- the long
 
 - 
readPayloadReaderpublic ByteArrayBuffer readPayloadReader(int offset, int length) 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
writeBeginpublic void writeBegin(byte a_identifier) 
 - 
writeBitMappublic final void writeBitMap(BitMap4 nullBitMap) 
 - 
writeBytepublic final void writeByte(byte a_byte) Description copied from interface:WriteBufferwrites a single byte to the buffer.- Specified by:
- writeBytein interface- WriteBuffer
- Parameters:
- a_byte- the byte
 
 - 
writeEndpublic void writeEnd() 
 - 
writeIntpublic final void writeInt(int a_int) Description copied from interface:WriteBufferwrites an int to the buffer.- Specified by:
- writeIntin interface- WriteBuffer
- Parameters:
- a_int- the int
 
 - 
writeIDOfpublic void writeIDOf(Transaction trans, java.lang.Object obj) 
 - 
writeIDOfpublic void writeIDOf(Transaction trans, PersistentBase persistent) 
 - 
canWritePersistentBaseprotected boolean canWritePersistentBase() 
 - 
writeShortStringpublic void writeShortString(Transaction trans, java.lang.String a_string) 
 - 
writeLongpublic void writeLong(long l) Description copied from interface:WriteBufferwrites a long to the buffer- Specified by:
- writeLongin interface- WriteBuffer
- Parameters:
- l- the long
 
 - 
incrementIntSizepublic void incrementIntSize() - Specified by:
- incrementIntSizein interface- ReadWriteBuffer
 
 - 
offsetpublic int offset() Description copied from interface:ReadBufferreturns the current offset in the buffer- Specified by:
- offsetin interface- ReadBuffer
- Returns:
- the offset
 
 - 
ensureSizepublic void ensureSize(int size) 
 - 
skippublic void skip(int length) 
 - 
checkXBytespublic void checkXBytes(boolean flag) 
 - 
checkXBytespublic boolean checkXBytes() 
 - 
eofpublic boolean eof() 
 - 
remainingByteCountpublic int remainingByteCount() 
 
- 
 
-