Package io.objectbox.flatbuffers
Class FlexBuffers
java.lang.Object
io.objectbox.flatbuffers.FlexBuffers
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 ClassesModifier and TypeClassDescriptionstatic classRepresents a array of bytes element in the bufferstatic classstatic classRepresents a key element in the buffer.static classRepresent a vector of keys in a mapstatic classMap object representing a set of key-value pairs.static classRepresents an generic element in the buffer.static classObject that represents a set of elements with the same typestatic classObject that represents a set of elements in the buffer -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intRepresent a blob typestatic final intRepresent a boolean typestatic final intRepresent a float typestatic final intRepresent a indirect float typestatic final intRepresent a indirect signed integer typestatic final intRepresent a indirect unsigned integer typestatic final intRepresent a signed integer typestatic final intRepresent a key to a map typestatic final intRepresent a map typestatic final intRepresent a null typestatic final intRepresent a string typestatic final intRepresent a unsigned typestatic final intRepresent a vector typestatic final intRepresent a vector of booleans typestatic final intRepresent a vector of floats typestatic final intstatic final intstatic final intstatic final intRepresent a vector of signed integers typestatic final intstatic final intstatic final intstatic final intRepresent a vector of keys typestatic final intRepresent a vector of strings typestatic final intRepresent a vector of unsigned integers typestatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FlexBuffers.ReferenceReads a FlexBuffer message in ReadBuf and returnsFlexBuffers.Referenceto the root element.static FlexBuffers.ReferencegetRoot(ByteBuffer buffer) Deprecated.
-
Field Details
-
FBT_NULL
public static final int FBT_NULLRepresent a null type- See Also:
-
FBT_INT
public static final int FBT_INTRepresent a signed integer type- See Also:
-
FBT_UINT
public static final int FBT_UINTRepresent a unsigned type- See Also:
-
FBT_FLOAT
public static final int FBT_FLOATRepresent a float type- See Also:
-
FBT_KEY
public static final int FBT_KEYRepresent a key to a map type- See Also:
-
FBT_STRING
public static final int FBT_STRINGRepresent a string type- See Also:
-
FBT_INDIRECT_INT
public static final int FBT_INDIRECT_INTRepresent a indirect signed integer type- See Also:
-
FBT_INDIRECT_UINT
public static final int FBT_INDIRECT_UINTRepresent a indirect unsigned integer type- See Also:
-
FBT_INDIRECT_FLOAT
public static final int FBT_INDIRECT_FLOATRepresent a indirect float type- See Also:
-
FBT_MAP
public static final int FBT_MAPRepresent a map type- See Also:
-
FBT_VECTOR
public static final int FBT_VECTORRepresent a vector type- See Also:
-
FBT_VECTOR_INT
public static final int FBT_VECTOR_INTRepresent a vector of signed integers type- See Also:
-
FBT_VECTOR_UINT
public static final int FBT_VECTOR_UINTRepresent a vector of unsigned integers type- See Also:
-
FBT_VECTOR_FLOAT
public static final int FBT_VECTOR_FLOATRepresent a vector of floats type- See Also:
-
FBT_VECTOR_KEY
public static final int FBT_VECTOR_KEYRepresent a vector of keys type- See Also:
-
FBT_VECTOR_STRING_DEPRECATED
public static final int FBT_VECTOR_STRING_DEPRECATEDRepresent a vector of strings type- See Also:
-
FBT_VECTOR_INT2
public static final int FBT_VECTOR_INT2- See Also:
-
FBT_VECTOR_UINT2
public static final int FBT_VECTOR_UINT2- See Also:
-
FBT_VECTOR_FLOAT2
public static final int FBT_VECTOR_FLOAT2- See Also:
-
FBT_VECTOR_INT3
public static final int FBT_VECTOR_INT3- See Also:
-
FBT_VECTOR_UINT3
public static final int FBT_VECTOR_UINT3- See Also:
-
FBT_VECTOR_FLOAT3
public static final int FBT_VECTOR_FLOAT3- See Also:
-
FBT_VECTOR_INT4
public static final int FBT_VECTOR_INT4- See Also:
-
FBT_VECTOR_UINT4
public static final int FBT_VECTOR_UINT4- See Also:
-
FBT_VECTOR_FLOAT4
public static final int FBT_VECTOR_FLOAT4- See Also:
-
FBT_BLOB
public static final int FBT_BLOBRepresent a blob type- See Also:
-
FBT_BOOL
public static final int FBT_BOOLRepresent a boolean type- See Also:
-
FBT_VECTOR_BOOL
public static final int FBT_VECTOR_BOOLRepresent a vector of booleans type- See Also:
-
-
Constructor Details
-
FlexBuffers
public FlexBuffers()
-
-
Method Details
-
getRoot
Deprecated.Reads a FlexBuffer message in ReadBuf and returnsFlexBuffers.Referenceto the root element.- Parameters:
buffer- ReadBuf containing FlexBuffer message- Returns:
FlexBuffers.Referenceto the root object
-
getRoot
Reads a FlexBuffer message in ReadBuf and returnsFlexBuffers.Referenceto the root element.- Parameters:
buffer- ReadBuf containing FlexBuffer message- Returns:
FlexBuffers.Referenceto the root object
-