Class GraphBinaryWriter
Allows to serialize objects to GraphBinary.
Inherited Members
Namespace: Gremlin.Net.Structure.IO.GraphBinary
Assembly: Gremlin.Net.dll
Syntax
public class GraphBinaryWriter
Constructors
GraphBinaryWriter(TypeSerializerRegistry?)
Initializes a new instance of the GraphBinaryWriter class.
Declaration
public GraphBinaryWriter(TypeSerializerRegistry? registry = null)
Parameters
| Type | Name | Description |
|---|---|---|
| TypeSerializerRegistry | registry | The TypeSerializerRegistry to use for serialization. |
Fields
VersionByte
A byte representing the version of the GraphBinary specification.
Declaration
public const byte VersionByte = 129
Field Value
| Type | Description |
|---|---|
| byte |
Methods
WriteAsync(object?, Stream, CancellationToken)
Writes an object in fully-qualified format, containing {type_code}{type_info}{value_flag}{value}.
Declaration
public Task WriteAsync(object? value, Stream stream, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | The value to write. |
| Stream | stream | The stream to write to. |
| CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous write operation. |
WriteNonNullableValueAsync(object, Stream, CancellationToken)
Writes a non-nullable value without including type information.
Declaration
public Task WriteNonNullableValueAsync(object value, Stream stream, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | The value to write. |
| Stream | stream | The stream to write to. |
| CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous write operation. |
WriteNullableValueAsync(object?, Stream, CancellationToken)
Writes a nullable value without including type information.
Declaration
public Task WriteNullableValueAsync(object? value, Stream stream, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | The value to write. |
| Stream | stream | The stream to write to. |
| CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous write operation. |
WriteValueFlagNoneAsync(Stream, CancellationToken)
Writes a single byte with value 0, representing an unset value_flag.
Declaration
public Task WriteValueFlagNoneAsync(Stream stream, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream to write to. |
| CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous write operation. |
WriteValueFlagNullAsync(Stream, CancellationToken)
Writes a single byte representing the null value_flag.
Declaration
public Task WriteValueFlagNullAsync(Stream stream, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream to write to. |
| CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous write operation. |