public class Table extends Object
| Modifier and Type | Field and Description |
|---|---|
protected ByteBuffer |
bb
The underlying ByteBuffer to hold the data of the Table.
|
protected int |
bb_pos
Used to hold the position of the `bb` buffer.
|
| Constructor and Description |
|---|
Table() |
| Modifier and Type | Method and Description |
|---|---|
protected static boolean |
__has_identifier(ByteBuffer bb,
String ident)
Check if a
ByteBuffer contains a file identifier. |
protected int |
__indirect(int offset)
Retrieve a relative offset.
|
protected static int |
__indirect(int offset,
ByteBuffer bb)
Retrieve a relative offset.
|
protected int |
__offset(int vtable_offset)
Look up a field in the vtable.
|
protected static int |
__offset(int vtable_offset,
int offset,
ByteBuffer bb) |
void |
__reset()
Resets the internal state with a null
ByteBuffer and a zero position. |
protected void |
__reset(int _i,
ByteBuffer _bb)
Re-init the internal state with an external buffer
ByteBuffer and an offset within. |
protected String |
__string(int offset)
Create a Java `String` from UTF-8 data stored inside the FlatBuffer.
|
protected static String |
__string(int offset,
ByteBuffer bb,
Utf8 utf8)
Create a Java `String` from UTF-8 data stored inside the FlatBuffer.
|
protected Table |
__union(Table t,
int offset)
Initialize any Table-derived type to point to the union at the given `offset`.
|
protected static Table |
__union(Table t,
int offset,
ByteBuffer bb)
Initialize any Table-derived type to point to the union at the given `offset`.
|
protected ByteBuffer |
__vector_as_bytebuffer(int vector_offset,
int elem_size)
Get a whole vector as a ByteBuffer.
|
protected ByteBuffer |
__vector_in_bytebuffer(ByteBuffer bb,
int vector_offset,
int elem_size)
Initialize vector as a ByteBuffer.
|
protected int |
__vector_len(int offset)
Get the length of a vector.
|
protected int |
__vector(int offset)
Get the start data of a vector.
|
protected static int |
compareStrings(int offset_1,
byte[] key,
ByteBuffer bb)
Compare string from the buffer with the 'String' object.
|
protected static int |
compareStrings(int offset_1,
int offset_2,
ByteBuffer bb)
Compare two strings in the buffer.
|
ByteBuffer |
getByteBuffer()
Get the underlying ByteBuffer.
|
protected int |
keysCompare(Integer o1,
Integer o2,
ByteBuffer bb)
Compare two tables by the key.
|
protected void |
sortTables(int[] offsets,
ByteBuffer bb)
Sort tables by the key.
|
protected int bb_pos
protected ByteBuffer bb
public ByteBuffer getByteBuffer()
protected int __offset(int vtable_offset)
vtable_offset - An `int` offset to the vtable in the Table's ByteBuffer.protected static int __offset(int vtable_offset,
int offset,
ByteBuffer bb)
protected int __indirect(int offset)
offset - An `int` index into the Table's ByteBuffer containing the relative offset.protected static int __indirect(int offset,
ByteBuffer bb)
offset - An `int` index into a ByteBuffer containing the relative offset.bb - from which the relative offset will be retrieved.protected String __string(int offset)
offset - An `int` index into the Table's ByteBuffer.protected static String __string(int offset, ByteBuffer bb, Utf8 utf8)
offset - An `int` index into the Table's ByteBuffer.bb - Table ByteBuffer used to read a string at given offset.utf8 - decoder that creates a Java `String` from UTF-8 characters.protected int __vector_len(int offset)
offset - An `int` index into the Table's ByteBuffer.protected int __vector(int offset)
offset - An `int` index into the Table's ByteBuffer.protected ByteBuffer __vector_as_bytebuffer(int vector_offset, int elem_size)
ByteBuffer object,
but does not actually copy the data, it still refers to the same bytes
as the original ByteBuffer. Also useful with nested FlatBuffers, etc.vector_offset - The position of the vector in the byte bufferelem_size - The size of each element in the arrayByteBuffer for the arrayprotected ByteBuffer __vector_in_bytebuffer(ByteBuffer bb, int vector_offset, int elem_size)
ByteBuffer, creating no garbage to be collected.bb - The ByteBuffer for the arrayvector_offset - The position of the vector in the byte bufferelem_size - The size of each element in the arrayByteBuffer for the arrayprotected Table __union(Table t, int offset)
t - A `Table`-derived type that should point to the union at `offset`.offset - An `int` index into the Table's ByteBuffer.protected static Table __union(Table t, int offset, ByteBuffer bb)
t - A `Table`-derived type that should point to the union at `offset`.offset - An `int` index into the Table's ByteBuffer.bb - Table ByteBuffer used to initialize the object Table-derived type.protected static boolean __has_identifier(ByteBuffer bb, String ident)
ByteBuffer contains a file identifier.bb - A ByteBuffer to check if it contains the identifier
`ident`.ident - A `String` identifier of the FlatBuffer file.protected void sortTables(int[] offsets,
ByteBuffer bb)
offsets - An 'int' indexes of the tables into the bb.bb - A ByteBuffer to get the tables.protected int keysCompare(Integer o1, Integer o2, ByteBuffer bb)
o1 - An 'Integer' index of the first key into the bb.o2 - An 'Integer' index of the second key into the bb.bb - A ByteBuffer to get the keys.protected static int compareStrings(int offset_1,
int offset_2,
ByteBuffer bb)
offset_1 - An 'int' index of the first string into the bb.offset_2 - An 'int' index of the second string into the bb.bb - A ByteBuffer to get the strings.protected static int compareStrings(int offset_1,
byte[] key,
ByteBuffer bb)
offset_1 - An 'int' index of the first string into the bb.key - Second string as a byte array.bb - A ByteBuffer to get the first string.protected void __reset(int _i,
ByteBuffer _bb)
ByteBuffer and an offset within.
This method exists primarily to allow recycling Table instances without risking memory leaks
due to ByteBuffer references.public void __reset()
ByteBuffer and a zero position.
This method exists primarily to allow recycling Table instances without risking memory leaks
due to ByteBuffer references. The instance will be unusable until it is assigned
again to a ByteBuffer.Copyright © 2020. All rights reserved.