Interface ITypeSerializer
Represents a serializer for a certain type.
Namespace: Gremlin.Net.Structure.IO.GraphBinary
Assembly: cs.temp.dll.dll
Syntax
public interface ITypeSerializer
Properties
DataType
Gets the DataType that supported by this serializer.
Declaration
DataType DataType { get; }
Property Value
Type | Description |
---|---|
DataType |
Methods
ReadAsync(Stream, GraphBinaryReader, CancellationToken)
Reads the type information and value from the stream.
Declaration
Task<object> ReadAsync(Stream stream, GraphBinaryReader reader, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The GraphBinary data to parse. |
GraphBinaryReader | reader | A GraphBinaryReader that can be used to read nested values. |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> | The read value. |
ReadValueAsync(Stream, GraphBinaryReader, Boolean, CancellationToken)
Reads the value from the stream (not the type information).
Declaration
Task<object> ReadValueAsync(Stream stream, GraphBinaryReader reader, bool nullable, CancellationToken cancellationToken = null)
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. |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> | The read value. |
WriteAsync(Object, Stream, GraphBinaryWriter, CancellationToken)
Writes the type code, information and value to a stream.
Declaration
Task WriteAsync(object value, Stream stream, GraphBinaryWriter writer, CancellationToken cancellationToken = null)
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. |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task that represents the asynchronous write operation. |
WriteValueAsync(Object, Stream, GraphBinaryWriter, Boolean, CancellationToken)
Writes the value to a stream, composed by the value flag and the sequence of bytes.
Declaration
Task WriteValueAsync(object value, Stream stream, GraphBinaryWriter writer, bool nullable, CancellationToken cancellationToken = null)
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. |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task that represents the asynchronous write operation. |