Package io.objectbox.flatbuffers
Class FlexBuffers
- java.lang.Object
-
- io.objectbox.flatbuffers.FlexBuffers
-
public class FlexBuffers extends java.lang.Object
This class can be used to parse FlexBuffer messages.For generating FlexBuffer messages, use
FlexBuffersBuilder
.Example of usage:
ReadBuf bb = ... // load message from file or network FlexBuffers.Reference r = FlexBuffers.getRoot(bb); // Reads the root element FlexBuffers.Map map = r.asMap(); // We assumed root object is a map System.out.println(map.get("name").asString()); // prints element with key "name"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FlexBuffers.Blob
Represents a array of bytes element in the bufferstatic class
FlexBuffers.FlexBufferException
static class
FlexBuffers.Key
Represents a key element in the buffer.static class
FlexBuffers.KeyVector
Represent a vector of keys in a mapstatic class
FlexBuffers.Map
Map object representing a set of key-value pairs.static class
FlexBuffers.Reference
Represents an generic element in the buffer.static class
FlexBuffers.TypedVector
Object that represents a set of elements with the same typestatic class
FlexBuffers.Vector
Object that represents a set of elements in the buffer
-
Field Summary
Fields Modifier and Type Field Description static int
FBT_BLOB
Represent a blob typestatic int
FBT_BOOL
Represent a boolean typestatic int
FBT_FLOAT
Represent a float typestatic int
FBT_INDIRECT_FLOAT
Represent a indirect float typestatic int
FBT_INDIRECT_INT
Represent a indirect signed integer typestatic int
FBT_INDIRECT_UINT
Represent a indirect unsigned integer typestatic int
FBT_INT
Represent a signed integer typestatic int
FBT_KEY
Represent a key to a map typestatic int
FBT_MAP
Represent a map typestatic int
FBT_NULL
Represent a null typestatic int
FBT_STRING
Represent a string typestatic int
FBT_UINT
Represent a unsigned typestatic int
FBT_VECTOR
Represent a vector typestatic int
FBT_VECTOR_BOOL
Represent a vector of booleans typestatic int
FBT_VECTOR_FLOAT
Represent a vector of floats typestatic int
FBT_VECTOR_FLOAT2
static int
FBT_VECTOR_FLOAT3
static int
FBT_VECTOR_FLOAT4
static int
FBT_VECTOR_INT
Represent a vector of signed integers typestatic int
FBT_VECTOR_INT2
static int
FBT_VECTOR_INT3
static int
FBT_VECTOR_INT4
static int
FBT_VECTOR_KEY
Represent a vector of keys typestatic int
FBT_VECTOR_STRING_DEPRECATED
Represent a vector of strings typestatic int
FBT_VECTOR_UINT
Represent a vector of unsigned integers typestatic int
FBT_VECTOR_UINT2
static int
FBT_VECTOR_UINT3
static int
FBT_VECTOR_UINT4
-
Constructor Summary
Constructors Constructor Description FlexBuffers()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static FlexBuffers.Reference
getRoot(ReadBuf buffer)
Reads a FlexBuffer message in ReadBuf and returnsFlexBuffers.Reference
to the root element.static FlexBuffers.Reference
getRoot(java.nio.ByteBuffer buffer)
Deprecated.
-
-
-
Field Detail
-
FBT_NULL
public static final int FBT_NULL
Represent a null type- See Also:
- Constant Field Values
-
FBT_INT
public static final int FBT_INT
Represent a signed integer type- See Also:
- Constant Field Values
-
FBT_UINT
public static final int FBT_UINT
Represent a unsigned type- See Also:
- Constant Field Values
-
FBT_FLOAT
public static final int FBT_FLOAT
Represent a float type- See Also:
- Constant Field Values
-
FBT_KEY
public static final int FBT_KEY
Represent a key to a map type- See Also:
- Constant Field Values
-
FBT_STRING
public static final int FBT_STRING
Represent a string type- See Also:
- Constant Field Values
-
FBT_INDIRECT_INT
public static final int FBT_INDIRECT_INT
Represent a indirect signed integer type- See Also:
- Constant Field Values
-
FBT_INDIRECT_UINT
public static final int FBT_INDIRECT_UINT
Represent a indirect unsigned integer type- See Also:
- Constant Field Values
-
FBT_INDIRECT_FLOAT
public static final int FBT_INDIRECT_FLOAT
Represent a indirect float type- See Also:
- Constant Field Values
-
FBT_MAP
public static final int FBT_MAP
Represent a map type- See Also:
- Constant Field Values
-
FBT_VECTOR
public static final int FBT_VECTOR
Represent a vector type- See Also:
- Constant Field Values
-
FBT_VECTOR_INT
public static final int FBT_VECTOR_INT
Represent a vector of signed integers type- See Also:
- Constant Field Values
-
FBT_VECTOR_UINT
public static final int FBT_VECTOR_UINT
Represent a vector of unsigned integers type- See Also:
- Constant Field Values
-
FBT_VECTOR_FLOAT
public static final int FBT_VECTOR_FLOAT
Represent a vector of floats type- See Also:
- Constant Field Values
-
FBT_VECTOR_KEY
public static final int FBT_VECTOR_KEY
Represent a vector of keys type- See Also:
- Constant Field Values
-
FBT_VECTOR_STRING_DEPRECATED
public static final int FBT_VECTOR_STRING_DEPRECATED
Represent a vector of strings type- See Also:
- Constant Field Values
-
FBT_VECTOR_INT2
public static final int FBT_VECTOR_INT2
- See Also:
- Constant Field Values
-
FBT_VECTOR_UINT2
public static final int FBT_VECTOR_UINT2
- See Also:
- Constant Field Values
-
FBT_VECTOR_FLOAT2
public static final int FBT_VECTOR_FLOAT2
- See Also:
- Constant Field Values
-
FBT_VECTOR_INT3
public static final int FBT_VECTOR_INT3
- See Also:
- Constant Field Values
-
FBT_VECTOR_UINT3
public static final int FBT_VECTOR_UINT3
- See Also:
- Constant Field Values
-
FBT_VECTOR_FLOAT3
public static final int FBT_VECTOR_FLOAT3
- See Also:
- Constant Field Values
-
FBT_VECTOR_INT4
public static final int FBT_VECTOR_INT4
- See Also:
- Constant Field Values
-
FBT_VECTOR_UINT4
public static final int FBT_VECTOR_UINT4
- See Also:
- Constant Field Values
-
FBT_VECTOR_FLOAT4
public static final int FBT_VECTOR_FLOAT4
- See Also:
- Constant Field Values
-
FBT_BLOB
public static final int FBT_BLOB
Represent a blob type- See Also:
- Constant Field Values
-
FBT_BOOL
public static final int FBT_BOOL
Represent a boolean type- See Also:
- Constant Field Values
-
FBT_VECTOR_BOOL
public static final int FBT_VECTOR_BOOL
Represent a vector of booleans type- See Also:
- Constant Field Values
-
-
Method Detail
-
getRoot
@Deprecated public static FlexBuffers.Reference getRoot(java.nio.ByteBuffer buffer)
Deprecated.Reads a FlexBuffer message in ReadBuf and returnsFlexBuffers.Reference
to the root element.- Parameters:
buffer
- ReadBuf containing FlexBuffer message- Returns:
FlexBuffers.Reference
to the root object
-
getRoot
public static FlexBuffers.Reference getRoot(ReadBuf buffer)
Reads a FlexBuffer message in ReadBuf and returnsFlexBuffers.Reference
to the root element.- Parameters:
buffer
- ReadBuf containing FlexBuffer message- Returns:
FlexBuffers.Reference
to the root object
-
-