public interface TypeSerializer<T>
| Modifier and Type | Method and Description |
|---|---|
DataType |
getDataType()
Gets the
DataType that is represented by the given T. |
T |
read(Buffer buffer,
GraphBinaryReader context)
Reads the type information and value from the buffer and returns an instance of T.
|
T |
readValue(Buffer buffer,
GraphBinaryReader context,
boolean nullable)
Reads the value from the buffer (not the type information) and returns an instance of T.
|
void |
write(T value,
Buffer buffer,
GraphBinaryWriter context)
Writes the type code, information and value to a buffer using the provided allocator.
|
void |
writeValue(T value,
Buffer buffer,
GraphBinaryWriter context,
boolean nullable)
Writes the value to a buffer, composed by the value flag and the sequence of bytes.
|
T read(Buffer buffer, GraphBinaryReader context) throws IOException
IOExceptionT readValue(Buffer buffer, GraphBinaryReader context, boolean nullable) throws IOException
Implementors should throw an exception when a complex type doesn't support reading without the type information.
IOExceptionvoid write(T value, Buffer buffer, GraphBinaryWriter context) throws IOException
IOExceptionvoid writeValue(T value, Buffer buffer, GraphBinaryWriter context, boolean nullable) throws IOException
IOExceptionCopyright © 2013–2022 Apache Software Foundation. All rights reserved.