Reads/writes various data types as binary values in a specific encoding.
This class does not use any buffering of its own.
It is permissible to seek, read from, and write to the underlying stream.
void | |
Flushes the underlying stream. Note that BinaryStream does not use any buffering of its own that
requires flushing. |
int | Read(byte[] buffer, int offset, int count) |
Reads a sequence of bytes from the underlying stream and advances the position within the stream by the number of
bytes read. |
bool | | Reads a boolean value from the stream. |
byte | | Reads a byte from the stream. |
byte[] | |
Reads the specified number of bytes from the stream. |
char | | Reads a character from the stream. |
DateTime | | Reads a DateTime from the stream. |
decimal | | Reads a decimal number from the stream. |
double | | Reads a double-precision floating-point number from the stream. |
float | | Reads a single-precision floating-point number from the stream. |
int | | Reads a 32-bit signed integer from the stream. |
long | | Reads a 64-bit signed integer from the stream. |
MemoryStream | |
Reads a length-prefixed block of bytes from the stream (for example, one produced by BinaryStream.WriteMemoryStream(MemoryStream)). |
sbyte | | Reads a signed byte from the stream. |
short | | Reads a 16-bit signed integer from the stream. |
string | | Reads a string from the stream. |
TimeSpan | | Reads a TimeSpan from the stream. |
uint | | Reads a 32-bit unsigned integer from the stream. |
ulong | | Reads a 64-bit unsigned integer from the stream. |
ushort | | Reads a 16-bit unsigned integer from the stream. |
int | |
Reads a 32-bit signed integer using optim encoding (see StreamExtensions.ReadInt32Optim(this Stream)) from the
stream. |
long | |
Reads a 64-bit signed integer using optim encoding (see StreamExtensions.ReadInt64Optim(this Stream)) from the
stream. |
uint | |
Reads a 32-bit unsigned integer using optim encoding (see StreamExtensions.ReadUInt32Optim(this Stream)) from the
stream. |
ulong | |
Reads a 64-bit unsigned integer using optim encoding (see StreamExtensions.ReadUInt64Optim(this Stream)) from the
stream. |
long | Seek(long offset, SeekOrigin origin) |
Sets the position within the underlying stream. |
void | |
Sets the length of the underlying stream. |
void | Write(byte[] buffer, int offset, int count) |
Writes a sequence of bytes to the current stream and advances the current position within this stream by the
number of bytes written. |
void | | Writes a boolean value to the stream. |
void | | Writes a byte to the stream. |
void | |
Writes the specified byte array into the stream. |
void | | Writes a character to the stream. |
void | | Writes a DateTime to the stream. |
void | | Writes a decimal number to the stream. |
void | | Writes a double-precision floating-point number to the stream. |
void | | Writes a single-precision floating-point number to the stream. |
void | | Writes a 32-bit signed integer to the stream. |
void | | Writes a 64-bit signed integer to the stream. |
void | |
Writes the data contained in the specified MemoryStream to the stream as a length-prefixed block of
bytes. |
void | | Writes a signed byte to the stream. |
void | | Writes a 16-bit signed integer to the stream. |
void | | Writes a string to the stream. |
void | | Writes a TimeSpan to the stream. |
void | | Writes a 32-bit unsigned integer to the stream. |
void | | Writes a 64-bit unsigned integer to the stream. |
void | | Writes a 16-bit unsigned integer to the stream. |
void | |
Writes a 32-bit signed integer using optim encoding (see StreamExtensions.WriteInt32Optim(this Stream, int)) to the
stream. |
void | |
Writes a 64-bit signed integer using optim encoding (see StreamExtensions.WriteInt64Optim(this Stream, long)) to the
stream. |
void | |
Writes a 32-bit unsigned integer using optim encoding (see StreamExtensions.WriteUInt32Optim(this Stream, uint)) to the
stream. |
void | |
Writes a 64-bit unsigned integer using optim encoding (see StreamExtensions.WriteUInt64Optim(this Stream, ulong)) to the
stream. |