type.
int | FillBuffer(this Stream stream, byte[] buffer, int offset, int length) |
Attempts to fill the buffer with the specified number of bytes from the stream. If there are fewer bytes left
in the stream than requested then all available bytes will be read into the buffer. |
Task<int> | FillBufferAsync(this Stream stream, byte[] buffer, int offset, int length, CancellationToken? token = null) |
byte[] | Read(this Stream stream, int length) |
Attempts to read the specified number of bytes from the stream. If there are fewer bytes left before the end
of the stream, a shorter (possibly empty) array is returned. |
byte[] | | Reads all bytes until the end of stream and returns them in a byte array. |
Task<byte[]> | |
long | |
Reads all bytes until the end of stream and returns the number of bytes thus read without allocating too much
memory. |
Task<long> | |
string | ReadAllText(this Stream stream, Encoding encoding = null) |
Reads all bytes from the current Stream and converts them into text using the specified encoding. |
Task<string> | ReadAllTextAsync(this Stream stream, Encoding encoding = null, CancellationToken? token = null) |
Task<byte[]> | ReadAsync(this Stream stream, int length, CancellationToken? token = null) |
Attempts to read the specified number of bytes from the stream. If there are fewer bytes left before the end
of the stream, a shorter (possibly empty) array is returned. |
decimal | | Decodes a decimal encoded by StreamExtensions.WriteDecimalOptim(this Stream, decimal). |
int | |
Decodes an integer encoded by StreamExtensions.WriteInt32Optim(this Stream, int) or StreamExtensions.WriteUInt32Optim(this Stream, uint). |
long | |
Decodes an integer encoded by StreamExtensions.WriteInt64Optim(this Stream, long) or StreamExtensions.WriteUInt64Optim(this Stream, ulong). |
uint | | Decodes an integer encoded by StreamExtensions.WriteUInt32Optim(this Stream, uint). |
ulong | | Decodes an integer encoded by StreamExtensions.WriteUInt64Optim(this Stream, ulong). |
void | Write(this Stream stream, byte[] data) | Writes the specified data to the current stream. |
Task | WriteAsync(this Stream stream, byte[] data, CancellationToken? token = null) |
Writes the specified data to the current stream. |
void | |
Encodes a decimal in a variable number of bytes, using fewer bytes for frequently-occurring low-precision
values. |
void | |
Encodes a 32-bit signed integer in a variable number of bytes, using fewer bytes for values closer to zero. |
void | |
Encodes a 64-bit signed integer in a variable number of bytes, using fewer bytes for values closer to zero. |
void | |
Encodes a 32-bit unsigned integer in a variable number of bytes, using fewer bytes for smaller values. |
void | |
Encodes a 64-bit unsigned integer in a variable number of bytes, using fewer bytes for smaller values. |
void | |
Encodes the specified string as UTF-8 and writes it to the current stream. |