Class StreamExtensions
Provides extension methods for
Inheritance
Inherited Members
Namespace: Gremlin.Net.Structure.IO.GraphBinary
Assembly: cs.temp.dll.dll
Syntax
public static class StreamExtensions
Methods
ReadAsync(Stream, Int32, CancellationToken)
Asynchronously reads a byte[] from a
Declaration
public static async Task<byte[]> ReadAsync(this Stream stream, int count, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The |
System.Int32 | count | The number of bytes to read. |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Byte[]> | The read byte[]. |
ReadBoolAsync(Stream, CancellationToken)
Asynchronously reads a System.Boolean from a
Declaration
public static async Task<bool> ReadBoolAsync(this Stream stream, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | The read System.Boolean. |
ReadByteAsync(Stream, CancellationToken)
Asynchronously reads a System.Byte from a
Declaration
public static async Task<byte> ReadByteAsync(this Stream stream, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Byte> | The read System.Byte. |
ReadDoubleAsync(Stream, CancellationToken)
Asynchronously reads a System.Double from a
Declaration
public static async Task<double> ReadDoubleAsync(this Stream stream, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Double> | The read System.Double. |
ReadFloatAsync(Stream, CancellationToken)
Asynchronously reads a System.Single from a
Declaration
public static async Task<float> ReadFloatAsync(this Stream stream, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Single> | The read System.Single. |
ReadIntAsync(Stream, CancellationToken)
Asynchronously reads an System.Int32 from a
Declaration
public static async Task<int> ReadIntAsync(this Stream stream, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Int32> | The read System.Int32. |
ReadLongAsync(Stream, CancellationToken)
Asynchronously reads a System.Int64 from a
Declaration
public static async Task<long> ReadLongAsync(this Stream stream, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Int64> | The read System.Int64. |
ReadShortAsync(Stream, CancellationToken)
Asynchronously reads a System.Int16 from a
Declaration
public static async Task<short> ReadShortAsync(this Stream stream, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Int16> | The read System.Int16. |
WriteAsync(Stream, Byte[], CancellationToken)
Asynchronously writes a byte[] to a
Declaration
public static async Task WriteAsync(this Stream stream, byte[] value, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The |
System.Byte[] | value | The byte[] to write. |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
WriteBoolAsync(Stream, Boolean, CancellationToken)
Asynchronously writes a System.Boolean to a
Declaration
public static async Task WriteBoolAsync(this Stream stream, bool value, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The |
System.Boolean | value | The System.Boolean to write. |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
WriteByteAsync(Stream, Byte, CancellationToken)
Asynchronously writes a System.Byte to a
Declaration
public static async Task WriteByteAsync(this Stream stream, byte value, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The |
System.Byte | value | The System.Byte to write. |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
WriteDoubleAsync(Stream, Double, CancellationToken)
Asynchronously writes a System.Double to a
Declaration
public static async Task WriteDoubleAsync(this Stream stream, double value, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The |
System.Double | value | The System.Double to write. |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
WriteFloatAsync(Stream, Single, CancellationToken)
Asynchronously writes a System.Single to a
Declaration
public static async Task WriteFloatAsync(this Stream stream, float value, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The |
System.Single | value | The System.Single to write. |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
WriteIntAsync(Stream, Int32, CancellationToken)
Asynchronously writes an System.Int32 to a
Declaration
public static async Task WriteIntAsync(this Stream stream, int value, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The |
System.Int32 | value | The System.Int32 to write. |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
WriteLongAsync(Stream, Int64, CancellationToken)
Asynchronously writes a System.Int64 to a
Declaration
public static async Task WriteLongAsync(this Stream stream, long value, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The |
System.Int64 | value | The System.Int64 to write. |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
WriteShortAsync(Stream, Int16, CancellationToken)
Asynchronously writes a System.Int16 to a
Declaration
public static async Task WriteShortAsync(this Stream stream, short value, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The |
System.Int16 | value | The System.Int16 to write. |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |