Extension methods for reading big-endian versions of data
More...
Extension methods for reading big-endian versions of data
◆ ReadInt16BE()
static short pluginbase.Helpers.Extensions.EndianExtensions.ReadInt16BE |
( |
this BinaryReader |
reader | ) |
|
|
static |
Read 16-bit integer big-endian
- Returns
- The int16
- Parameters
-
Attribute: 1] | data[0
<< 8);
18 byte[] data = reader.ReadBytes(2);
19 return (
short)(data[1] | data[0] << 8);
◆ ReadInt32BE()
static int pluginbase.Helpers.Extensions.EndianExtensions.ReadInt32BE |
( |
this BinaryReader |
reader | ) |
|
|
static |
Reads 32 bit big-endian
- Returns
- The int32
- Parameters
-
Attribute: 3] | data[2] << 8 | data[1] << 16 | data[0
<< 24;
29 byte[] data = reader.ReadBytes(4);
30 return data[3] | data[2] << 8 | data[1] << 16 | data[0] << 24;
◆ ReadInt64BE()
static long pluginbase.Helpers.Extensions.EndianExtensions.ReadInt64BE |
( |
this BinaryReader |
reader | ) |
|
|
static |
Reads 64-bit big-endian
- Returns
- The int64
- Parameters
-
42 return high << 32 | low;
static int ReadInt32BE(this BinaryReader reader)
Reads 32 bit big-endian
Definition: EndianExtensions.cs:27
The documentation for this class was generated from the following file: