Search Results for

    Show / Hide Table of Contents

    Class StreamExtensions

    Provides extension methods for Stream that are mostly useful when implementing GraphBinary serializers.

    Inheritance
    object
    StreamExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Gremlin.Net.Structure.IO.GraphBinary
    Assembly: Gremlin.Net.dll
    Syntax
    public static class StreamExtensions

    Methods

    ReadAsync(Stream, int, CancellationToken)

    Asynchronously reads a byte[] from a Stream into a buffer.

    Declaration
    public static Task<byte[]> ReadAsync(this Stream stream, int count, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Stream stream

    The Stream to read from.

    int count

    The number of bytes to read.

    CancellationToken cancellationToken

    The token to cancel the operation. The default value is None.

    Returns
    Type Description
    Task<byte[]>

    The read byte[].

    ReadBoolAsync(Stream, CancellationToken)

    Asynchronously reads a bool from a Stream.

    Declaration
    public static Task<bool> ReadBoolAsync(this Stream stream, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Stream stream

    The Stream to read from.

    CancellationToken cancellationToken

    The token to cancel the operation. The default value is None.

    Returns
    Type Description
    Task<bool>

    The read bool.

    ReadByteAsync(Stream, CancellationToken)

    Asynchronously reads a byte from a Stream.

    Declaration
    public static Task<byte> ReadByteAsync(this Stream stream, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Stream stream

    The Stream to read from.

    CancellationToken cancellationToken

    The token to cancel the operation. The default value is None.

    Returns
    Type Description
    Task<byte>

    The read byte.

    ReadDoubleAsync(Stream, CancellationToken)

    Asynchronously reads a double from a Stream.

    Declaration
    public static Task<double> ReadDoubleAsync(this Stream stream, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Stream stream

    The Stream to read from.

    CancellationToken cancellationToken

    The token to cancel the operation. The default value is None.

    Returns
    Type Description
    Task<double>

    The read double.

    ReadFloatAsync(Stream, CancellationToken)

    Asynchronously reads a float from a Stream.

    Declaration
    public static Task<float> ReadFloatAsync(this Stream stream, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Stream stream

    The Stream to read from.

    CancellationToken cancellationToken

    The token to cancel the operation. The default value is None.

    Returns
    Type Description
    Task<float>

    The read float.

    ReadIntAsync(Stream, CancellationToken)

    Asynchronously reads an int from a Stream.

    Declaration
    public static Task<int> ReadIntAsync(this Stream stream, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Stream stream

    The Stream to read from.

    CancellationToken cancellationToken

    The token to cancel the operation. The default value is None.

    Returns
    Type Description
    Task<int>

    The read int.

    ReadLongAsync(Stream, CancellationToken)

    Asynchronously reads a long from a Stream.

    Declaration
    public static Task<long> ReadLongAsync(this Stream stream, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Stream stream

    The Stream to read from.

    CancellationToken cancellationToken

    The token to cancel the operation. The default value is None.

    Returns
    Type Description
    Task<long>

    The read long.

    ReadShortAsync(Stream, CancellationToken)

    Asynchronously reads a short from a Stream.

    Declaration
    public static Task<short> ReadShortAsync(this Stream stream, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Stream stream

    The Stream to read from.

    CancellationToken cancellationToken

    The token to cancel the operation. The default value is None.

    Returns
    Type Description
    Task<short>

    The read short.

    WriteAsync(Stream, byte[], CancellationToken)

    Asynchronously writes a byte[] to a Stream.

    Declaration
    public static Task WriteAsync(this Stream stream, byte[] value, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Stream stream

    The Stream to write the byte[] to.

    byte[] value

    The byte[] to write.

    CancellationToken cancellationToken

    The token to cancel the operation. The default value is None.

    Returns
    Type Description
    Task

    WriteBoolAsync(Stream, bool, CancellationToken)

    Asynchronously writes a bool to a Stream.

    Declaration
    public static Task WriteBoolAsync(this Stream stream, bool value, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Stream stream

    The Stream to write the bool to.

    bool value

    The bool to write.

    CancellationToken cancellationToken

    The token to cancel the operation. The default value is None.

    Returns
    Type Description
    Task

    WriteByteAsync(Stream, byte, CancellationToken)

    Asynchronously writes a byte to a Stream.

    Declaration
    public static Task WriteByteAsync(this Stream stream, byte value, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Stream stream

    The Stream to write the byte to.

    byte value

    The byte to write.

    CancellationToken cancellationToken

    The token to cancel the operation. The default value is None.

    Returns
    Type Description
    Task

    WriteDoubleAsync(Stream, double, CancellationToken)

    Asynchronously writes a double to a Stream.

    Declaration
    public static Task WriteDoubleAsync(this Stream stream, double value, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Stream stream

    The Stream to write the double to.

    double value

    The double to write.

    CancellationToken cancellationToken

    The token to cancel the operation. The default value is None.

    Returns
    Type Description
    Task

    WriteFloatAsync(Stream, float, CancellationToken)

    Asynchronously writes a float to a Stream.

    Declaration
    public static Task WriteFloatAsync(this Stream stream, float value, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Stream stream

    The Stream to write the float to.

    float value

    The float to write.

    CancellationToken cancellationToken

    The token to cancel the operation. The default value is None.

    Returns
    Type Description
    Task

    WriteIntAsync(Stream, int, CancellationToken)

    Asynchronously writes an int to a Stream.

    Declaration
    public static Task WriteIntAsync(this Stream stream, int value, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Stream stream

    The Stream to write the int to.

    int value

    The int to write.

    CancellationToken cancellationToken

    The token to cancel the operation. The default value is None.

    Returns
    Type Description
    Task

    WriteLongAsync(Stream, long, CancellationToken)

    Asynchronously writes a long to a Stream.

    Declaration
    public static Task WriteLongAsync(this Stream stream, long value, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Stream stream

    The Stream to write the long to.

    long value

    The long to write.

    CancellationToken cancellationToken

    The token to cancel the operation. The default value is None.

    Returns
    Type Description
    Task

    WriteShortAsync(Stream, short, CancellationToken)

    Asynchronously writes a short to a Stream.

    Declaration
    public static Task WriteShortAsync(this Stream stream, short value, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Stream stream

    The Stream to write the short to.

    short value

    The short to write.

    CancellationToken cancellationToken

    The token to cancel the operation. The default value is None.

    Returns
    Type Description
    Task
    In this article
    Back to top Copyright © 2018 The Apache Software Foundation