public class FlexBuffers extends Object
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"
| Modifier and Type | Class and Description |
|---|---|
static class |
FlexBuffers.Blob
Represents a array of bytes element in the buffer
|
static 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 map
|
static 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 type
|
static class |
FlexBuffers.Vector
Object that represents a set of elements in the buffer
|
| Modifier and Type | Field and Description |
|---|---|
static int |
FBT_BLOB
Represent a blob type
|
static int |
FBT_BOOL
Represent a boolean type
|
static int |
FBT_FLOAT
Represent a float type
|
static int |
FBT_INDIRECT_FLOAT
Represent a indirect float type
|
static int |
FBT_INDIRECT_INT
Represent a indirect signed integer type
|
static int |
FBT_INDIRECT_UINT
Represent a indirect unsigned integer type
|
static int |
FBT_INT
Represent a signed integer type
|
static int |
FBT_KEY
Represent a key to a map type
|
static int |
FBT_MAP
Represent a map type
|
static int |
FBT_NULL
Represent a null type
|
static int |
FBT_STRING
Represent a string type
|
static int |
FBT_UINT
Represent a unsigned type
|
static int |
FBT_VECTOR
Represent a vector type
|
static int |
FBT_VECTOR_BOOL
Represent a vector of booleans type
|
static int |
FBT_VECTOR_FLOAT
Represent a vector of floats type
|
static 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 type
|
static int |
FBT_VECTOR_INT2 |
static int |
FBT_VECTOR_INT3 |
static int |
FBT_VECTOR_INT4 |
static int |
FBT_VECTOR_KEY
Represent a vector of keys type
|
static int |
FBT_VECTOR_STRING_DEPRECATED
Represent a vector of strings type
|
static int |
FBT_VECTOR_UINT
Represent a vector of unsigned integers type
|
static int |
FBT_VECTOR_UINT2 |
static int |
FBT_VECTOR_UINT3 |
static int |
FBT_VECTOR_UINT4 |
| Constructor and Description |
|---|
FlexBuffers() |
| Modifier and Type | Method and Description |
|---|---|
static FlexBuffers.Reference |
getRoot(ByteBuffer buffer)
Deprecated.
|
static FlexBuffers.Reference |
getRoot(com.google.flatbuffers.ReadBuf buffer)
Reads a FlexBuffer message in ReadBuf and returns
FlexBuffers.Reference to
the root element. |
public static final int FBT_NULL
public static final int FBT_INT
public static final int FBT_UINT
public static final int FBT_FLOAT
public static final int FBT_KEY
public static final int FBT_STRING
public static final int FBT_INDIRECT_INT
public static final int FBT_INDIRECT_UINT
public static final int FBT_INDIRECT_FLOAT
public static final int FBT_MAP
public static final int FBT_VECTOR
public static final int FBT_VECTOR_INT
public static final int FBT_VECTOR_UINT
public static final int FBT_VECTOR_FLOAT
public static final int FBT_VECTOR_KEY
public static final int FBT_VECTOR_STRING_DEPRECATED
public static final int FBT_VECTOR_INT2
public static final int FBT_VECTOR_UINT2
public static final int FBT_VECTOR_FLOAT2
public static final int FBT_VECTOR_INT3
public static final int FBT_VECTOR_UINT3
public static final int FBT_VECTOR_FLOAT3
public static final int FBT_VECTOR_INT4
public static final int FBT_VECTOR_UINT4
public static final int FBT_VECTOR_FLOAT4
public static final int FBT_BLOB
public static final int FBT_BOOL
public static final int FBT_VECTOR_BOOL
@Deprecated public static FlexBuffers.Reference getRoot(ByteBuffer buffer)
FlexBuffers.Reference to
the root element.buffer - ReadBuf containing FlexBuffer messageFlexBuffers.Reference to the root objectpublic static FlexBuffers.Reference getRoot(com.google.flatbuffers.ReadBuf buffer)
FlexBuffers.Reference to
the root element.buffer - ReadBuf containing FlexBuffer messageFlexBuffers.Reference to the root objectCopyright © 2020. All rights reserved.