- Enclosing class:
- ByteBufferProxy
public abstract static class ByteBufferProxy.AbstractByteBufferProxy
extends BufferProxy<ByteBuffer>
Provides
ByteBuffer pooling and address resolution for concrete
BufferProxy implementations.-
Field Summary
FieldsFields inherited from class org.lmdbjava.BufferProxy
MDB_VAL_STRUCT_SIZE, STRUCT_FIELD_OFFSET_DATA, STRUCT_FIELD_OFFSET_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final longaddress(ByteBuffer buffer) final ByteBufferallocate()Allocate a new buffer suitable for passing toBufferProxy.out(java.lang.Object, jnr.ffi.Pointer, long).final intcompare(ByteBuffer o1, ByteBuffer o2) Compare the two buffers.static intcompareBuff(ByteBuffer o1, ByteBuffer o2) Lexicographically compare two buffers.final voiddeallocate(ByteBuffer buff) Deallocate a buffer that was previously provided byBufferProxy.allocate().static Fieldprotected byte[]getBytes(ByteBuffer buffer) Obtain a copy of the bytes contained within the passed buffer.Methods inherited from class org.lmdbjava.BufferProxy
in, in, out
-
Field Details
-
FIELD_NAME_ADDRESS
- See Also:
-
FIELD_NAME_CAPACITY
- See Also:
-
-
Constructor Details
-
AbstractByteBufferProxy
public AbstractByteBufferProxy()
-
-
Method Details
-
compareBuff
Lexicographically compare two buffers.- Parameters:
o1- left operand (required)o2- right operand (required)- Returns:
- as specified by
Comparableinterface
-
findField
-
address
-
allocate
Description copied from class:BufferProxyAllocate a new buffer suitable for passing toBufferProxy.out(java.lang.Object, jnr.ffi.Pointer, long).- Specified by:
allocatein classBufferProxy<ByteBuffer>- Returns:
- a buffer for passing to the
outmethod
-
compare
Description copied from class:BufferProxyCompare the two buffers.Implemented as a protected method to discourage use of the buffer proxy in collections etc (given by design it wraps a temporary value only).
- Specified by:
comparein classBufferProxy<ByteBuffer>- Parameters:
o1- left operando2- right operand- Returns:
- as per
Comparable
-
deallocate
Description copied from class:BufferProxyDeallocate a buffer that was previously provided byBufferProxy.allocate().- Specified by:
deallocatein classBufferProxy<ByteBuffer>- Parameters:
buff- the buffer to deallocate (required)
-
getBytes
Description copied from class:BufferProxyObtain a copy of the bytes contained within the passed buffer.- Specified by:
getBytesin classBufferProxy<ByteBuffer>- Parameters:
buffer- a non-null buffer created by this proxy instance- Returns:
- a copy of the bytes this buffer is currently representing
-