public class GraphBinaryWriter extends Object
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.
Modifier and Type | Field and Description |
---|---|
static byte |
VERSION_BYTE |
Constructor and Description |
---|
GraphBinaryWriter() |
GraphBinaryWriter(TypeSerializerRegistry registry) |
Modifier and Type | Method and Description |
---|---|
<T> void |
write(T value,
Buffer buffer)
Writes an object in fully-qualified format, containing {type_code}{type_info}{value_flag}{value}.
|
<T> void |
writeFullyQualifiedNull(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> void |
writeValue(T value,
Buffer buffer,
boolean nullable)
Writes a value without including type information.
|
void |
writeValueFlagNone(Buffer buffer)
Writes a single byte with value 0, representing an unset value_flag.
|
void |
writeValueFlagNull(Buffer buffer)
Writes a single byte representing the null value_flag.
|
public static final byte VERSION_BYTE
public GraphBinaryWriter()
public GraphBinaryWriter(TypeSerializerRegistry registry)
public <T> void writeValue(T value, Buffer buffer, boolean nullable) throws IOException
IOException
public <T> void write(T value, Buffer buffer) throws IOException
IOException
public <T> void writeFullyQualifiedNull(Class<T> objectClass, Buffer buffer, Object information) throws IOException
Note that for simple types, the provided information will be null
.
IOException
public void writeValueFlagNull(Buffer buffer)
public void writeValueFlagNone(Buffer buffer)
Copyright © 2013–2020 Apache Software Foundation. All rights reserved.