Skip to content

StreamExtensions Class

Definition

Extension methods for reading and writing primitive values from a Stream.

public static class StreamExtensions

View source

Methods

Name Description
ReadAllBytes(Stream) Reads all remaining bytes from the stream.
ReadAllBytesAsync(Stream, CancellationToken) Reads all remaining bytes from the stream asynchronously.
ReadByteOrThrow(Stream) Reads a single byte from the stream, throwing EndOfStreamException if the end of the stream has been reached.
ReadByteOrThrowAsync(Stream, CancellationToken) Reads a single byte from the stream asynchronously, throwing EndOfStreamException if the end of the stream has been reached.
ReadExactly(Stream, Int32) Reads exactly length bytes from the stream, throwing EndOfStreamException if the end of the stream has been reached.
ReadExactlyAsync(Stream, Int32, CancellationToken) Reads exactly length bytes from the stream asynchronously, throwing EndOfStreamException if the end of the stream has been reached.
ReadInt16OrThrow(Stream, Endian) Reads a Int16 from the stream, throwing EndOfStreamException if the end of the stream has been reached.
ReadInt16OrThrowAsync(Stream, Endian, CancellationToken) Reads a Int16 from the stream asynchronously, throwing EndOfStreamException if the end of the stream has been reached.
ReadInt32OrThrow(Stream, Endian) Reads an Int32 from the stream, throwing EndOfStreamException if the end of the stream has been reached.
ReadInt32OrThrowAsync(Stream, Endian, CancellationToken) Reads an Int32 from the stream asynchronously, throwing EndOfStreamException if the end of the stream has been reached.
ReadInt64OrThrow(Stream, Endian) Reads a Int64 from the stream, throwing EndOfStreamException if the end of the stream has been reached.
ReadInt64OrThrowAsync(Stream, Endian, CancellationToken) Reads a Int64 from the stream asynchronously, throwing EndOfStreamException if the end of the stream has been reached.
ReadUInt16OrThrow(Stream, Endian) Reads a UInt16 from the stream, throwing EndOfStreamException if the end of the stream has been reached.
ReadUInt16OrThrowAsync(Stream, Endian, CancellationToken) Reads a UInt16 from the stream asynchronously, throwing EndOfStreamException if the end of the stream has been reached.
ReadUInt24OrThrow(Stream, Endian) Reads a UInt24 from the stream, throwing EndOfStreamException if the end of the stream has been reached.
ReadUInt24OrThrowAsync(Stream, Endian, CancellationToken) Reads a UInt24 from the stream asynchronously, throwing EndOfStreamException if the end of the stream has been reached.
ReadUInt32OrThrow(Stream, Endian) Reads a UInt32 from the stream, throwing EndOfStreamException if the end of the stream has been reached.
ReadUInt32OrThrowAsync(Stream, Endian, CancellationToken) Reads a UInt32 from the stream asynchronously, throwing EndOfStreamException if the end of the stream has been reached.
ReadUInt64OrThrow(Stream, Endian) Reads a UInt64 from the stream, throwing EndOfStreamException if the end of the stream has been reached.
ReadUInt64OrThrowAsync(Stream, Endian, CancellationToken) Reads a UInt64 from the stream asynchronously, throwing EndOfStreamException if the end of the stream has been reached.
WriteInt16(Stream, Int16, Endian) Writes a Int16 to the stream.
WriteInt16Async(Stream, Int16, Endian, CancellationToken) Writes a Int16 to the stream asynchronously.
WriteInt32(Stream, Int32, Endian) Writes an Int32 to the stream.
WriteInt32Async(Stream, Int32, Endian, CancellationToken) Writes an Int32 to the stream asynchronously.
WriteInt64(Stream, Int64, Endian) Writes a Int64 to the stream.
WriteInt64Async(Stream, Int64, Endian, CancellationToken) Writes a Int64 to the stream asynchronously.
WriteUInt16(Stream, UInt16, Endian) Writes a UInt16 to the stream.
WriteUInt16Async(Stream, UInt16, Endian, CancellationToken) Writes a UInt16 to the stream asynchronously.
WriteUInt24(Stream, UInt24, Endian) Writes a UInt24 to the stream.
WriteUInt24Async(Stream, UInt24, Endian, CancellationToken) Writes a UInt24 to the stream asynchronously.
WriteUInt32(Stream, UInt32, Endian) Writes a UInt32 to the stream.
WriteUInt32Async(Stream, UInt32, Endian, CancellationToken) Writes a UInt32 to the stream asynchronously.
WriteUInt64(Stream, UInt64, Endian) Writes a UInt64 to the stream.
WriteUInt64Async(Stream, UInt64, Endian, CancellationToken) Writes a UInt64 to the stream asynchronously.