Class BiEndianBinaryReader
Extends the BinaryReader class to allow reading values in the specified format.
Implements
Inherited Members
Namespace: NetTopologySuite.IO
Assembly: NetTopologySuite.dll
Syntax
public class BiEndianBinaryReader : BinaryReader, IDisposable
Remarks
While BiEndianBinaryReader extends BinaryReader adding methods for reading integer values (ReadInt32()) and double values (ReadDouble()) in the specified format, this implementation overrides methods, such ReadInt32() and ReadDouble() and more, for reading values in the specified by Endianess format.
Constructors
| Edit this page View SourceBiEndianBinaryReader(Stream)
Initializes a new instance of the BiEndianBinaryReader class.
Declaration
public BiEndianBinaryReader(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream. |
BiEndianBinaryReader(Stream, ByteOrder)
Initializes a new instance of the BiEndianBinaryReader class.
Declaration
public BiEndianBinaryReader(Stream input, ByteOrder endianess)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | input | The supplied stream. |
| ByteOrder | endianess | The byte order. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | The stream does not support reading, the stream is null, or the stream is already closed. |
Properties
| Edit this page View SourceEndianess
Encoding type
Declaration
public ByteOrder Endianess { get; set; }
Property Value
| Type | Description |
|---|---|
| ByteOrder |
Methods
| Edit this page View SourceReadDecimal()
Reads a decimal value from the current stream and advances the current position of the stream by sixteen bytes.
Declaration
public override decimal ReadDecimal()
Returns
| Type | Description |
|---|---|
| decimal | A decimal value read from the current stream. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | The stream is closed. |
| IOException | An I/O error occurs. |
| EndOfStreamException | The end of the stream is reached. |
ReadDouble()
Reads an 8-byte floating point value from the current stream using the specified encoding and advances the current position of the stream by eight bytes.
Declaration
public override double ReadDouble()
Returns
| Type | Description |
|---|---|
| double | An 8-byte floating point value read from the current stream. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | The stream is closed. |
| IOException | An I/O error occurs. |
| EndOfStreamException | The end of the stream is reached. |
ReadInt16()
Reads a 2-byte signed integer from the current stream using the specified encoding and advances the current position of the stream by two bytes.
Declaration
public override short ReadInt16()
Returns
| Type | Description |
|---|---|
| short | A 2-byte signed integer read from the current stream. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | The stream is closed. |
| IOException | An I/O error occurs. |
| EndOfStreamException | The end of the stream is reached. |
ReadInt32()
Reads a 4-byte signed integer from the current stream using the specified encoding and advances the current position of the stream by four bytes.
Declaration
public override int ReadInt32()
Returns
| Type | Description |
|---|---|
| int | A 4-byte signed integer read from the current stream. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | The stream is closed. |
| IOException | An I/O error occurs. |
| EndOfStreamException | The end of the stream is reached. |
ReadInt64()
Reads an 8-byte signed integer from the current stream using the specified encoding and advances the current position of the stream by eight bytes.
Declaration
public override long ReadInt64()
Returns
| Type | Description |
|---|---|
| long | An 8-byte signed integer read from the current stream. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | The stream is closed. |
| IOException | An I/O error occurs. |
| EndOfStreamException | The end of the stream is reached. |
ReadSingle()
Reads a 4-byte floating point value from the current stream using the specified encoding and advances the current position of the stream by four bytes.
Declaration
public override float ReadSingle()
Returns
| Type | Description |
|---|---|
| float | A 4-byte floating point value read from the current stream. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | The stream is closed. |
| IOException | An I/O error occurs. |
| EndOfStreamException | The end of the stream is reached. |
ReadString()
Reads a string from the current stream. The string is prefixed with the length, encoded as an integer seven bits at a time.
Declaration
public override string ReadString()
Returns
| Type | Description |
|---|---|
| string | The string being read. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | The stream is closed. |
| IOException | An I/O error occurs. |
| EndOfStreamException | The end of the stream is reached. |
ReadUInt16()
Reads a 2-byte unsigned integer from the current stream using the specified encoding and advances the position of the stream by two bytes.
Declaration
[CLSCompliant(false)]
public override ushort ReadUInt16()
Returns
| Type | Description |
|---|---|
| ushort | A 2-byte unsigned integer read from this stream. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | The stream is closed. |
| IOException | An I/O error occurs. |
| EndOfStreamException | The end of the stream is reached. |
ReadUInt32()
Reads a 4-byte unsigned integer from the current stream using the specified encoding and advances the position of the stream by four bytes.
Declaration
[CLSCompliant(false)]
public override uint ReadUInt32()
Returns
| Type | Description |
|---|---|
| uint | A 4-byte unsigned integer read from this stream. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | The stream is closed. |
| IOException | An I/O error occurs. |
| EndOfStreamException | The end of the stream is reached. |
ReadUInt64()
Reads an 8-byte unsigned integer from the current stream using the specified encoding and advances the position of the stream by eight bytes.
Declaration
[CLSCompliant(false)]
public override ulong ReadUInt64()
Returns
| Type | Description |
|---|---|
| ulong | An 8-byte unsigned integer read from this stream. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | The stream is closed. |
| IOException | An I/O error occurs. |
| EndOfStreamException | The end of the stream is reached. |