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
| Improve this Doc 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
| Improve this Doc View SourceEndianess
Encoding type
Declaration
public ByteOrder Endianess { get; set; }
Property Value
Type | Description |
---|---|
ByteOrder |
Methods
| Improve this Doc 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 |
---|---|
Int16 | 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 |
---|---|
Int32 | 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 |
---|---|
Int64 | 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 |
---|---|
Single | 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 |
---|---|
UInt16 | 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 |
---|---|
UInt32 | 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 |
---|---|
UInt64 | 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. |