PeterO.BinaryIO

PeterO.BinaryIO

public sealed class BinaryIO

Reads and writes data types in little endian or big endian.

Member Summary

BinaryIO Constructor

public BinaryIO(
    System.IO.Stream stream);

Initializes a new instance of the PeterO.BinaryIO class. Initializes a new BinaryIO instance.

Parameters:

Exceptions:

CanRead

public bool CanRead { get; }

Gets a value indicating whether the underlying stream can be read. Returns:

true if the underlying stream can be read; otherwise, false .

CanSeek

public bool CanSeek { get; }

Gets a value indicating whether the underlying stream supports seeking. Returns:

true if the underlying stream supports seeking; otherwise, false .

CanWrite

public bool CanWrite { get; }

Gets a value indicating whether the underlying stream supports writing. Returns:

true if the underlying stream supports writing; otherwise, false .

Length

public long Length { get; }

Gets the length of the underlying stream. Returns:

The length of the underlying stream.

Position

public long Position { get; set; }

Gets or sets the position of the underlying stream. Returns:

The position of the underlying stream.

Read

public int Read(
    byte[] data,
    int offset,
    int length);

Not documented yet.

Parameters:

Return Value:

A 32-bit signed integer.

Exceptions:

Read7BitEncodedInt32BE

public int Read7BitEncodedInt32BE();

Not documented yet.

Return Value:

A 32-bit signed integer.

Read7BitEncodedInt32LE

public int Read7BitEncodedInt32LE();

Reads a signed 32-bit integer encoded in 7-bit encoding to the stream. In 7-bit encoding, an integer is encoded in one or more bytes. Each byte contains 7 bits of the result, starting with the least-significant bits. If the eighth (highest) bit is 1, then the byte that follows it contains 7 more bits, and so on. Otherwise, the process stops and the resulting integer is returned. The return value of this method can be up to 32 bits long. If bit 32 is 1, the return value is negative; otherwise positive.

Return Value:

A 32-bit signed integer.

Read7BitEncodedInt64BE

public long Read7BitEncodedInt64BE();

Not documented yet.

Return Value:

A 64-bit signed integer.

Read7BitEncodedInt64LE

public long Read7BitEncodedInt64LE();

Not documented yet.

Return Value:

A 64-bit signed integer.

Read7BitEncodedUInt32BE

public int Read7BitEncodedUInt32BE();

Not documented yet.

Return Value:

A 32-bit signed integer.

Read7BitEncodedUInt32LE

public int Read7BitEncodedUInt32LE();

Reads an unsigned 32-bit integer encoded in 7-bit encoding to the stream. In 7-bit encoding, an integer is encoded in one or more bytes. Each byte contains 7 bits of the result, starting with the least-significant bits. If the eighth (highest) bit is 1, then the byte that follows it contains 7 more bits, and so on. Otherwise, the process stops and the resulting integer is returned. The return value of this method can be up to 31 bits long and is positive.

Return Value:

A 32-bit signed integer.

ReadByte

public byte ReadByte();

Not documented yet.

Return Value:

A byte (from 0 to 255).

ReadBytes

public byte[] ReadBytes(
    int size);

Reads data from a stream into a byte array.

Parameters:

Return Value:

A byte array containing the data read.

ReadDoubleBE

public double ReadDoubleBE();

Reads a 64-bit floating-point number in big-endian byte order.

Return Value:

A 64-bit floating-point number.

ReadDoubleLE

public double ReadDoubleLE();

Not documented yet.

Return Value:

A 64-bit floating-point number.

ReadInt16BE

public short ReadInt16BE();

Reads a 16-bit signed integer in big-endian byte order (2 bytes).

Return Value:

A 16-bit signed integer.

ReadInt16LE

public short ReadInt16LE();

Not documented yet.

Return Value:

A 16-bit signed integer.

ReadInt32BE

public int ReadInt32BE();

Reads a 32-bit signed integer in big-endian byte order (4 bytes).

Return Value:

A 32-bit signed integer.

ReadInt32LE

public int ReadInt32LE();

Not documented yet.

Return Value:

A 32-bit signed integer.

ReadInt64BE

public long ReadInt64BE();

Reads a 64-bit signed integer in big-endian byte order (8 bytes).

Return Value:

A 64-bit signed integer.

ReadInt64LE

public long ReadInt64LE();

Not documented yet.

Return Value:

A 64-bit signed integer.

ReadSingleBE

public float ReadSingleBE();

Not documented yet.

Return Value:

A 32-bit floating-point number.

ReadSingleLE

public float ReadSingleLE();

Not documented yet.

Return Value:

A 32-bit floating-point number.

Write

public void Write(
    byte value);

Not documented yet.

Parameters:

Write

public void Write(
    byte[] data);

Not documented yet.

Parameters:

Exceptions:

Write

public void Write(
    byte[] data,
    int offset,
    int length);

Not documented yet.

Parameters:

Exceptions:

Write7BitEncodedInt32BE

public int Write7BitEncodedInt32BE(
    int value);

Not documented yet.

Parameters:

Return Value:

A 32-bit signed integer.

Write7BitEncodedInt32LE

public int Write7BitEncodedInt32LE(
    int value);

Not documented yet.

Parameters:

Return Value:

A 32-bit signed integer.

Write7BitEncodedInt64BE

public int Write7BitEncodedInt64BE(
    long value);

Not documented yet.

Parameters:

Return Value:

A 32-bit signed integer.

Write7BitEncodedInt64LE

public int Write7BitEncodedInt64LE(
    long value);

Not documented yet.

Parameters:

Return Value:

A 32-bit signed integer.

Write7BitEncodedUInt32BE

public int Write7BitEncodedUInt32BE(
    int value);

Not documented yet.

Parameters:

Return Value:

A 32-bit signed integer.

Write7BitEncodedUInt32LE

public int Write7BitEncodedUInt32LE(
    int value);

Not documented yet.

Parameters:

Return Value:

A 32-bit signed integer.

WriteBE

public void WriteBE(
    byte value);

Not documented yet.

Parameters:

WriteBE

public void WriteBE(
    double value);

Not documented yet.

Parameters:

WriteBE

public void WriteBE(
    float value);

Not documented yet.

Parameters:

WriteBE

public void WriteBE(
    int value);

Not documented yet.

Parameters:

WriteBE

public void WriteBE(
    long value);

Not documented yet.

Parameters:

WriteBE

public void WriteBE(
    short value);

Not documented yet.

Parameters:

WriteLE

public void WriteLE(
    byte value);

Not documented yet.

Parameters:

WriteLE

public void WriteLE(
    double value);

Not documented yet.

Parameters:

WriteLE

public void WriteLE(
    float value);

Not documented yet.

Parameters:

WriteLE

public void WriteLE(
    int value);

Not documented yet.

Parameters:

WriteLE

public void WriteLE(
    long value);

Not documented yet.

Parameters:

WriteLE

public void WriteLE(
    short value);

Not documented yet.

Parameters:

Back to petero-csharp start page.