Class BigEndianBinaryReader
Provides methods for reading primitive data types as big-endian values from a stream.
Implements
Inherited Members
Namespace: TriLibCore.Utils
Assembly: TriLibCore.dll
Syntax
public class BigEndianBinaryReader : BinaryReader, IDisposable
Constructors
BigEndianBinaryReader(Stream)
Initializes a new instance of the BigEndianBinaryReader class based on the specified stream.
Declaration
public BigEndianBinaryReader(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The input stream. |
BigEndianBinaryReader(Stream, Encoding, bool)
Initializes a new instance of the BigEndianBinaryReader class based on the specified stream and character encoding, and optionally leaves the stream open.
Declaration
public BigEndianBinaryReader(Stream stream, Encoding encoding, bool leaveOpen)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The input stream. |
| Encoding | encoding | The character encoding. |
| bool | leaveOpen | true to leave the stream open after the BigEndianBinaryReader object is disposed; otherwise, false. |
Methods
ReadDouble()
Reads an 8-byte floating-point value from the current stream using big-endian encoding.
Declaration
public override double ReadDouble()
Returns
| Type | Description |
|---|---|
| double | An 8-byte floating-point value read from the current stream. |
Overrides
ReadInt16()
Reads a 2-byte signed integer from the current stream using big-endian encoding.
Declaration
public override short ReadInt16()
Returns
| Type | Description |
|---|---|
| short | A 2-byte signed integer read from the current stream. |
Overrides
ReadInt32()
Reads a 4-byte signed integer from the current stream using big-endian encoding.
Declaration
public override int ReadInt32()
Returns
| Type | Description |
|---|---|
| int | A 4-byte signed integer read from the current stream. |
Overrides
ReadInt64()
Reads an 8-byte signed integer from the current stream using big-endian encoding.
Declaration
public override long ReadInt64()
Returns
| Type | Description |
|---|---|
| long | An 8-byte signed integer read from the current stream. |
Overrides
ReadSingle()
Reads a 4-byte floating-point value from the current stream using big-endian encoding.
Declaration
public override float ReadSingle()
Returns
| Type | Description |
|---|---|
| float | A 4-byte floating-point value read from the current stream. |
Overrides
ReadUInt32()
Reads a 4-byte unsigned integer from the current stream using big-endian encoding.
Declaration
public override uint ReadUInt32()
Returns
| Type | Description |
|---|---|
| uint | A 4-byte unsigned integer read from the current stream. |