Class GraphBinaryWriter
java.lang.Object
org.apache.tinkerpop.gremlin.structure.io.binary.GraphBinaryWriter
Writes a value to a buffer using the
TypeSerializer instances configured in the
TypeSerializerRegistry.
This class exposes two different methods to write a value to a buffer:
write(Object, Buffer) and
writeValue(Object, Buffer, boolean):
write()method writes the binary representation of the{type_code}{type_info}{value_flag}{value}components.writeValue()method writes the{value_flag}{value}when a value is nullable and only{value}when a value is not nullable.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGraphBinaryWriter(TypeSerializerRegistry registry) GraphBinaryWriter(TypeSerializerRegistry registry, PDTRegistry pdtRegistry) -
Method Summary
Modifier and TypeMethodDescription<T> voidWrites an object in fully-qualified format, containing {type_code}{type_info}{value_flag}{value}.<T> voidwriteFullyQualifiedNull(Class<T> objectClass, Buffer buffer, Object information) Represents a null value of a specific type, useful when the parent type contains a type parameter that must be specified.<T> voidwriteValue(T value, Buffer buffer, boolean nullable) Writes a value without including type information.voidwriteValueFlagBulk(Buffer buffer) Writes a single byte with value 2, representing an ordered value_flag.voidwriteValueFlagNone(Buffer buffer) Writes a single byte with value 0, representing an unset value_flag.voidwriteValueFlagNull(Buffer buffer) Writes a single byte representing the null value_flag.voidwriteValueFlagOrdered(Buffer buffer) Writes a single byte with value 2, representing an ordered value_flag.
-
Field Details
-
VERSION_BYTE
public static final byte VERSION_BYTE- See Also:
-
BULKED_BYTE
public static final byte BULKED_BYTE- See Also:
-
-
Constructor Details
-
GraphBinaryWriter
public GraphBinaryWriter() -
GraphBinaryWriter
-
GraphBinaryWriter
-
-
Method Details
-
writeValue
Writes a value without including type information.- Throws:
IOException
-
write
Writes an object in fully-qualified format, containing {type_code}{type_info}{value_flag}{value}.- Throws:
IOException
-
writeFullyQualifiedNull
public <T> void writeFullyQualifiedNull(Class<T> objectClass, Buffer buffer, Object information) throws IOException Represents a null value of a specific type, useful when the parent type contains a type parameter that must be specified.Note that for simple types, the provided information will be
null.- Throws:
IOException
-
writeValueFlagNull
Writes a single byte representing the null value_flag. -
writeValueFlagNone
Writes a single byte with value 0, representing an unset value_flag. -
writeValueFlagOrdered
Writes a single byte with value 2, representing an ordered value_flag. -
writeValueFlagBulk
Writes a single byte with value 2, representing an ordered value_flag.
-