public class ByteArrayProxy extends BufferProxy<byte[]>
Env.create(org.lmdbjava.BufferProxy).| Modifier and Type | Field and Description |
|---|---|
static BufferProxy<byte[]> |
PROXY_BA
The byte array proxy.
|
MDB_VAL_STRUCT_SIZE, STRUCT_FIELD_OFFSET_DATA, STRUCT_FIELD_OFFSET_SIZE| Constructor and Description |
|---|
ByteArrayProxy() |
| Modifier and Type | Method and Description |
|---|---|
protected byte[] |
allocate()
Allocate a new buffer suitable for passing to
BufferProxy.out(java.lang.Object, jnr.ffi.Pointer, long). |
protected int |
compare(byte[] o1,
byte[] o2)
Compare the two buffers.
|
static int |
compareArrays(byte[] o1,
byte[] o2)
Lexicographically compare two byte arrays.
|
protected void |
deallocate(byte[] buff)
Deallocate a buffer that was previously provided by
BufferProxy.allocate(). |
protected byte[] |
getBytes(byte[] buffer)
Obtain a copy of the bytes contained within the passed buffer.
|
protected void |
in(byte[] buffer,
int size,
jnr.ffi.Pointer ptr,
long ptrAddr)
Called when the
MDB_val should be set to reflect the passed
buffer. |
protected void |
in(byte[] buffer,
jnr.ffi.Pointer ptr,
long ptrAddr)
Called when the
MDB_val should be set to reflect the passed
buffer. |
protected byte[] |
out(byte[] buffer,
jnr.ffi.Pointer ptr,
long ptrAddr)
Called when the
MDB_val may have changed and the passed buffer
should be modified to reflect the new MDB_val. |
public static final BufferProxy<byte[]> PROXY_BA
public static int compareArrays(byte[] o1,
byte[] o2)
o1 - left operand (required)o2 - right operand (required)Comparable interfaceprotected final byte[] allocate()
BufferProxyBufferProxy.out(java.lang.Object, jnr.ffi.Pointer, long).allocate in class BufferProxy<byte[]>out methodprotected final int compare(byte[] o1,
byte[] o2)
BufferProxyImplemented as a protected method to discourage use of the buffer proxy in collections etc (given by design it wraps a temporary value only).
compare in class BufferProxy<byte[]>o1 - left operando2 - right operandComparableprotected final void deallocate(byte[] buff)
BufferProxyBufferProxy.allocate().deallocate in class BufferProxy<byte[]>buff - the buffer to deallocate (required)protected final byte[] getBytes(byte[] buffer)
BufferProxygetBytes in class BufferProxy<byte[]>buffer - a non-null buffer created by this proxy instanceprotected final void in(byte[] buffer,
jnr.ffi.Pointer ptr,
long ptrAddr)
BufferProxyMDB_val should be set to reflect the passed
buffer. This buffer will have been created by end users, not
BufferProxy.allocate().in in class BufferProxy<byte[]>buffer - the buffer to write to MDB_valptr - the pointer to the MDB_valptrAddr - the address of the MDB_val pointerprotected final void in(byte[] buffer,
int size,
jnr.ffi.Pointer ptr,
long ptrAddr)
BufferProxyMDB_val should be set to reflect the passed
buffer.in in class BufferProxy<byte[]>buffer - the buffer to write to MDB_valsize - the buffer size to write to MDB_valptr - the pointer to the MDB_valptrAddr - the address of the MDB_val pointerprotected final byte[] out(byte[] buffer,
jnr.ffi.Pointer ptr,
long ptrAddr)
BufferProxyMDB_val may have changed and the passed buffer
should be modified to reflect the new MDB_val.out in class BufferProxy<byte[]>buffer - the buffer to write to MDB_valptr - the pointer to the MDB_valptrAddr - the address of the MDB_val pointerMDB_valCopyright © 2016–2018 The LmdbJava Open Source Project. All rights reserved.