Class CustomTypeSerializer
The interface to implement for serializers of custom types.
Inheritance
Implements
Inherited Members
Namespace: Gremlin.Net.Structure.IO.GraphBinary.Types
Assembly: cs.temp.dll.dll
Syntax
public abstract class CustomTypeSerializer : ITypeSerializer
Properties
DataType
Gets the DataType that supported by this serializer.
Declaration
public DataType DataType { get; }
Property Value
Type | Description |
---|---|
DataType |
TypeName
Gets the custom type name.
Declaration
public abstract string TypeName { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
ReadAsync(Stream, GraphBinaryReader)
Reads the type information and value from the stream.
Declaration
public abstract Task<object> ReadAsync(Stream stream, GraphBinaryReader reader)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The GraphBinary data to parse. |
GraphBinaryReader | reader | A GraphBinaryReader that can be used to read nested values. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> | The read value. |
ReadValueAsync(Stream, GraphBinaryReader, Boolean)
Reads the value from the stream (not the type information).
Declaration
public abstract Task<object> ReadValueAsync(Stream stream, GraphBinaryReader reader, bool nullable)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The GraphBinary data to parse. |
GraphBinaryReader | reader | A GraphBinaryReader that can be used to read nested values. |
System.Boolean | nullable | Whether or not the value can be null. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> | The read value. |
WriteAsync(Object, Stream, GraphBinaryWriter)
Writes the type code, information and value to a stream.
Declaration
public abstract Task WriteAsync(object value, Stream stream, GraphBinaryWriter writer)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value to write. |
Stream | stream | The stream to write to. |
GraphBinaryWriter | writer | A GraphBinaryWriter that can be used to write nested values. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task that represents the asynchronous write operation. |
WriteValueAsync(Object, Stream, GraphBinaryWriter, Boolean)
Writes the value to a stream, composed by the value flag and the sequence of bytes.
Declaration
public abstract Task WriteValueAsync(object value, Stream stream, GraphBinaryWriter writer, bool nullable)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value to write. |
Stream | stream | The stream to write to. |
GraphBinaryWriter | writer | A GraphBinaryWriter that can be used to write nested values. |
System.Boolean | nullable | Whether or not the value can be null. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task that represents the asynchronous write operation. |