Package com.db4o.internal
Class AbstractBufferContext
- java.lang.Object
-
- com.db4o.internal.AbstractBufferContext
-
- All Implemented Interfaces:
HandlerVersionContext
,BufferContext
,Context
,ReadBuffer
- Direct Known Subclasses:
AbstractReadContext
public abstract class AbstractBufferContext extends java.lang.Object implements BufferContext, HandlerVersionContext
-
-
Constructor Summary
Constructors Constructor Description AbstractBufferContext(Transaction transaction, ReadBuffer buffer)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ReadBuffer
buffer()
ReadBuffer
buffer(ReadBuffer buffer)
ObjectContainerBase
container()
abstract int
handlerVersion()
boolean
isLegacyHandlerVersion()
ObjectContainer
objectContainer()
int
offset()
returns the current offset in the bufferBitMap4
readBitMap(int bitCount)
byte
readByte()
reads a byte from the buffer.void
readBytes(byte[] bytes)
reads an array of bytes from the buffer.int
readInt()
reads an int from the buffer.long
readLong()
reads a long from the buffer.void
seek(int offset)
positions the read pointer at the specified positionSlotFormat
slotFormat()
Transaction
transaction()
-
-
-
Constructor Detail
-
AbstractBufferContext
public AbstractBufferContext(Transaction transaction, ReadBuffer buffer)
-
-
Method Detail
-
buffer
public ReadBuffer buffer(ReadBuffer buffer)
-
buffer
public ReadBuffer buffer()
- Specified by:
buffer
in interfaceBufferContext
-
readByte
public byte readByte()
Description copied from interface:ReadBuffer
reads a byte from the buffer.- Specified by:
readByte
in interfaceReadBuffer
- Returns:
- the byte
-
readBytes
public void readBytes(byte[] bytes)
Description copied from interface:ReadBuffer
reads 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:
readBytes
in interfaceReadBuffer
- Parameters:
bytes
- the byte array to read the bytes into.
-
readInt
public int readInt()
Description copied from interface:ReadBuffer
reads an int from the buffer.- Specified by:
readInt
in interfaceReadBuffer
- Returns:
- the int
-
readLong
public long readLong()
Description copied from interface:ReadBuffer
reads a long from the buffer.- Specified by:
readLong
in interfaceReadBuffer
- Returns:
- the long
-
offset
public int offset()
Description copied from interface:ReadBuffer
returns the current offset in the buffer- Specified by:
offset
in interfaceReadBuffer
- Returns:
- the offset
-
seek
public void seek(int offset)
Description copied from interface:ReadBuffer
positions the read pointer at the specified position- Specified by:
seek
in interfaceReadBuffer
- Parameters:
offset
- the desired position in the buffer
-
container
public ObjectContainerBase container()
-
objectContainer
public ObjectContainer objectContainer()
- Specified by:
objectContainer
in interfaceContext
-
transaction
public Transaction transaction()
- Specified by:
transaction
in interfaceContext
-
handlerVersion
public abstract int handlerVersion()
- Specified by:
handlerVersion
in interfaceHandlerVersionContext
-
isLegacyHandlerVersion
public boolean isLegacyHandlerVersion()
-
readBitMap
public BitMap4 readBitMap(int bitCount)
- Specified by:
readBitMap
in interfaceReadBuffer
-
slotFormat
public SlotFormat slotFormat()
- Specified by:
slotFormat
in interfaceHandlerVersionContext
-
-