[]
Analog of System.IO.BinaryReader but uses big-endian byte order.
public class BigEndianBinaryReader : IDisposable
Initializes a new instance of the BigEndianBinaryReader class.
public BigEndianBinaryReader(Stream baseStream, bool leaveOpen)
baseStream
System.IO.StreamThe underlying System.IO.Stream object.
leaveOpen
booltrue to leave the stream open after the System.IO.BinaryReader object is disposed; otherwise, false.
Releases all resources used by the current instance of the BigEndianBinaryReader class.
public void Dispose()
Releases the unmanaged resources used by the BigEndianBinaryReader class and optionally releases the managed resources.
protected void Dispose(bool disposing)
disposing
booltrue to release both managed and unmanaged resources; false to release only unmanaged resources.
protected ~BigEndianBinaryReader()
Reads the specified number of bytes from the current stream into a byte array and advances the current position by that number of bytes.
public byte[] ReadBytes(int count)
count
intThe number of bytes to read. This value must be 0 or a non-negative number or an exception will occur.
A byte array containing data read from the underlying stream. This might be less than the number of bytes requested if the end of the stream is reached.
Reads a 2-byte signed integer from the current stream and advances the current position of the stream by four bytes.
public short ReadInt16()
A 2-byte signed integer read from the current stream.
Reads a 4-byte signed integer from the current stream and advances the current position of the stream by four bytes.
public int ReadInt32()
A 4-byte signed integer read from the current stream.
Reads a 4-byte signed integer from the current stream using little-ending byte order and advances the current position of the stream by four bytes.
public int ReadInt32LE()
A 4-byte signed integer read from the current stream.
Reads a 2-byte unsigned integer from the current stream and advances the current position of the stream by four bytes.
public ushort ReadUInt16()
A 2-byte unsigned integer read from the current stream.
Reads a 4-byte unsigned integer from the current stream and advances the current position of the stream by four bytes.
public uint ReadUInt32()
A 4-byte unsigned integer read from the current stream.