C# Class FyreVM.BigEndian

Provides utility functions for working with big-endian numbers.
Show file Open project: ChicagoDave/Zifmia Class Usage Examples

Public Methods

Method Description
ReadInt16 ( Stream stream ) : ushort

Reads an unsigned, big-endian, 16-bit number from a stream.

ReadInt16 ( byte array, int offset ) : ushort

Reads an unsigned, big-endian, 16-bit number from a byte array.

ReadInt16 ( byte array, uint offset ) : ushort

Reads an unsigned, big-endian, 16-bit number from a byte array.

ReadInt32 ( Stream stream ) : uint

Reads an unsigned, big-endian, 32-bit number from a stream.

ReadInt32 ( byte array, int offset ) : uint

Reads an unsigned, big-endian, 32-bit number from a byte array.

ReadInt32 ( byte array, uint offset ) : uint

Reads an unsigned, big-endian, 32-bit number from a byte array.

WriteInt16 ( Stream stream, ushort value ) : void

Writes an unsigned, big-endian, 16-bit number to a stream.

WriteInt16 ( byte array, int offset, ushort value ) : void

Writes an unsigned, big-endian, 16-bit number into a byte array.

WriteInt16 ( byte array, uint offset, ushort value ) : void

Writes an unsigned, big-endian, 16-bit number into a byte array.

WriteInt32 ( Stream stream, uint value ) : void

Writes an unsigned, big-endian, 32-bit number to a stream.

WriteInt32 ( byte array, int offset, uint value ) : void

Writes an unsigned, big-endian, 32-bit number into a byte array.

WriteInt32 ( byte array, uint offset, uint value ) : void

Writes an unsigned, big-endian, 32-bit number into a byte array.

Method Details

ReadInt16() public static method

Reads an unsigned, big-endian, 16-bit number from a stream.
public static ReadInt16 ( Stream stream ) : ushort
stream Stream The stream to read from.
return ushort

ReadInt16() public static method

Reads an unsigned, big-endian, 16-bit number from a byte array.
public static ReadInt16 ( byte array, int offset ) : ushort
array byte The array to read from.
offset int The index within the array where the number starts.
return ushort

ReadInt16() public static method

Reads an unsigned, big-endian, 16-bit number from a byte array.
public static ReadInt16 ( byte array, uint offset ) : ushort
array byte The array to read from.
offset uint The index within the array where the number starts.
return ushort

ReadInt32() public static method

Reads an unsigned, big-endian, 32-bit number from a stream.
public static ReadInt32 ( Stream stream ) : uint
stream Stream The stream to read from.
return uint

ReadInt32() public static method

Reads an unsigned, big-endian, 32-bit number from a byte array.
public static ReadInt32 ( byte array, int offset ) : uint
array byte The array to read from.
offset int The index within the array where the number starts.
return uint

ReadInt32() public static method

Reads an unsigned, big-endian, 32-bit number from a byte array.
public static ReadInt32 ( byte array, uint offset ) : uint
array byte The array to read from.
offset uint The index within the array where the number starts.
return uint

WriteInt16() public static method

Writes an unsigned, big-endian, 16-bit number to a stream.
public static WriteInt16 ( Stream stream, ushort value ) : void
stream Stream The stream to write to.
value ushort The number to write.
return void

WriteInt16() public static method

Writes an unsigned, big-endian, 16-bit number into a byte array.
public static WriteInt16 ( byte array, int offset, ushort value ) : void
array byte The array to write into.
offset int The index within the array where the number will start.
value ushort The number to write.
return void

WriteInt16() public static method

Writes an unsigned, big-endian, 16-bit number into a byte array.
public static WriteInt16 ( byte array, uint offset, ushort value ) : void
array byte The array to write into.
offset uint The index within the array where the number will start.
value ushort The number to write.
return void

WriteInt32() public static method

Writes an unsigned, big-endian, 32-bit number to a stream.
public static WriteInt32 ( Stream stream, uint value ) : void
stream Stream The stream to write to.
value uint The number to write.
return void

WriteInt32() public static method

Writes an unsigned, big-endian, 32-bit number into a byte array.
public static WriteInt32 ( byte array, int offset, uint value ) : void
array byte The array to write into.
offset int The index within the array where the number will start.
value uint The number to write.
return void

WriteInt32() public static method

Writes an unsigned, big-endian, 32-bit number into a byte array.
public static WriteInt32 ( byte array, uint offset, uint value ) : void
array byte The array to write into.
offset uint The index within the array where the number will start.
value uint The number to write.
return void