private static final class HeapInvocationBuffer.DefaultEncoder extends HeapInvocationBuffer.Encoder
Modifier and Type | Field and Description |
---|---|
private HeapInvocationBuffer.ArrayIO |
io |
Constructor and Description |
---|
DefaultEncoder(HeapInvocationBuffer.ArrayIO io) |
Modifier and Type | Method and Description |
---|---|
int |
getBufferSize(CallContext callContext)
Gets the size in bytes of the buffer required for the function
|
int |
putAddress(byte[] buffer,
int offset,
long value)
Encodes a native memory address value into the byte array.
|
int |
putByte(byte[] buffer,
int offset,
int value)
Encodes a byte value into the byte array.
|
int |
putDouble(byte[] buffer,
int offset,
double value)
Encodes a double value into the byte array.
|
int |
putFloat(byte[] buffer,
int offset,
float value)
Encodes a float value into the byte array.
|
int |
putInt(byte[] buffer,
int offset,
int value)
Encodes an int value into the byte array.
|
int |
putLong(byte[] buffer,
int offset,
long value)
Encodes a long value into the byte array.
|
int |
putShort(byte[] buffer,
int offset,
int value)
Encodes a short value into the byte array.
|
int |
skipAddress(int offset) |
getInstance
private final HeapInvocationBuffer.ArrayIO io
public DefaultEncoder(HeapInvocationBuffer.ArrayIO io)
public final int getBufferSize(CallContext callContext)
HeapInvocationBuffer.Encoder
getBufferSize
in class HeapInvocationBuffer.Encoder
public final int putByte(byte[] buffer, int offset, int value)
HeapInvocationBuffer.Encoder
putByte
in class HeapInvocationBuffer.Encoder
buffer
- The destination byte buffer to place the encoded value.offset
- The offset within the destination buffer to place the value.value
- The value to encode.public final int putShort(byte[] buffer, int offset, int value)
HeapInvocationBuffer.Encoder
putShort
in class HeapInvocationBuffer.Encoder
buffer
- The destination byte buffer to place the encoded value.offset
- The offset within the destination buffer to place the value.value
- The value to encode.public final int putInt(byte[] buffer, int offset, int value)
HeapInvocationBuffer.Encoder
putInt
in class HeapInvocationBuffer.Encoder
buffer
- The destination byte buffer to place the encoded value.offset
- The offset within the destination buffer to place the value.value
- The value to encode.public final int putLong(byte[] buffer, int offset, long value)
HeapInvocationBuffer.Encoder
putLong
in class HeapInvocationBuffer.Encoder
buffer
- The destination byte buffer to place the encoded value.offset
- The offset within the destination buffer to place the value.value
- The value to encode.public final int putFloat(byte[] buffer, int offset, float value)
HeapInvocationBuffer.Encoder
putFloat
in class HeapInvocationBuffer.Encoder
buffer
- The destination byte buffer to place the encoded value.offset
- The offset within the destination buffer to place the value.value
- The value to encode.public final int putDouble(byte[] buffer, int offset, double value)
HeapInvocationBuffer.Encoder
putDouble
in class HeapInvocationBuffer.Encoder
buffer
- The destination byte buffer to place the encoded value.offset
- The offset within the destination buffer to place the value.value
- The value to encode.public final int putAddress(byte[] buffer, int offset, long value)
HeapInvocationBuffer.Encoder
putAddress
in class HeapInvocationBuffer.Encoder
buffer
- The destination byte buffer to place the encoded value.offset
- The offset within the destination buffer to place the value.value
- The value to encode.public int skipAddress(int offset)
skipAddress
in class HeapInvocationBuffer.Encoder