Skip to content

ByteArrayExtensions Class ​

Definition ​

Extension methods for reading and writing primitive values from byte arrays.

c#
public static class ByteArrayExtensions

View source

Methods ​

NameDescription
GetInt16(Byte[], Int32)Reads a little-endian Int16 from a byte array at the specified index.
GetInt16(Byte[], Int32, Endian)Reads a Int16 from a byte array at the specified index using the specified endianness.
GetInt32(Byte[], Int32)Reads a little-endian Int32 from a byte array at the specified index.
GetInt32(Byte[], Int32, Endian)Reads an Int32 from a byte array at the specified index using the specified endianness.
GetInt64(Byte[], Int32)Reads a little-endian Int64 from a byte array at the specified index.
GetInt64(Byte[], Int32, Endian)Reads a Int64 from a byte array at the specified index using the specified endianness.
GetUInt16(Byte[], Int32)Reads a little-endian UInt16 from a byte array at the specified index.
GetUInt16(Byte[], Int32, Endian)Reads a UInt16 from a byte array at the specified index using the specified endianness.
GetUInt24(Byte[], Int32)Reads a little-endian UInt24 from a byte array at the specified index.
GetUInt24(Byte[], Int32, Endian)Reads a UInt24 from a byte array at the specified index using the specified endianness.
GetUInt32(Byte[], Int32)Reads a little-endian UInt32 from a byte array at the specified index.
GetUInt32(Byte[], Int32, Endian)Reads a UInt32 from a byte array at the specified index using the specified endianness.
GetUInt64(Byte[], Int32)Reads a little-endian UInt64 from a byte array at the specified index.
GetUInt64(Byte[], Int32, Endian)Reads a UInt64 from a byte array at the specified index using the specified endianness.
SetInt16(Byte[], Int32, Int16)Writes a little-endian Int16 to a byte array at the specified index.
SetInt16(Byte[], Int32, Int16, Endian)Writes a Int16 to a byte array at the specified index using the specified endianness.
SetInt32(Byte[], Int32, Int32)Writes a little-endian Int32 to a byte array at the specified index.
SetInt32(Byte[], Int32, Int32, Endian)Writes an Int32 to a byte array at the specified index using the specified endianness.
SetInt64(Byte[], Int32, Int64)Writes a little-endian Int64 to a byte array at the specified index.
SetInt64(Byte[], Int32, Int64, Endian)Writes a Int64 to a byte array at the specified index using the specified endianness.
SetUInt16(Byte[], Int32, UInt16)Writes a little-endian UInt16 to a byte array at the specified index.
SetUInt16(Byte[], Int32, UInt16, Endian)Writes a UInt16 to a byte array at the specified index using the specified endianness.
SetUInt24(Byte[], Int32, UInt24)Writes a little-endian UInt24 to a byte array at the specified index.
SetUInt24(Byte[], Int32, UInt24, Endian)Writes a UInt24 to a byte array at the specified index using the specified endianness.
SetUInt32(Byte[], Int32, UInt32)Writes a little-endian UInt32 to a byte array at the specified index.
SetUInt32(Byte[], Int32, UInt32, Endian)Writes a UInt32 to a byte array at the specified index using the specified endianness.
SetUInt64(Byte[], Int32, UInt64)Writes a little-endian UInt64 to a byte array at the specified index.
SetUInt64(Byte[], Int32, UInt64, Endian)Writes a UInt64 to a byte array at the specified index using the specified endianness.