Class Binary
Common binary methods.
Inheritance
Inherited Members
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class Binary
Methods
BitStringToBytes(String)
Converts a bit-string to bytes.
Declaration
public static byte[] BitStringToBytes(string bitString)
Parameters
Type | Name | Description |
---|---|---|
System.String | bitString | The bit-string. |
Returns
Type | Description |
---|---|
System.Byte[] |
BitStringToBytes(String, Boolean)
Converts a bit-string to bytes.
Declaration
public static byte[] BitStringToBytes(string bitString, bool padLeft)
Parameters
Type | Name | Description |
---|---|---|
System.String | bitString | The bit-string. |
System.Boolean | padLeft | Whether to pad extra zero-bits to the left. |
Returns
Type | Description |
---|---|
System.Byte[] |
BitStringToBytes(String, Boolean, out Int32)
Converts a bit-string to bytes.
Declaration
public static byte[] BitStringToBytes(string bitString, bool padLeft, out int numberOfUnusedBits)
Parameters
Type | Name | Description |
---|---|---|
System.String | bitString | The bit-string. |
System.Boolean | padLeft | Whether to pad extra zero-bits to the left. |
System.Int32 | numberOfUnusedBits | The number of unused bits. |
Returns
Type | Description |
---|---|
System.Byte[] |
BitStringToBytes(String, out Int32)
Converts a bit-string to bytes.
Declaration
public static byte[] BitStringToBytes(string bitString, out int numberOfUnusedBits)
Parameters
Type | Name | Description |
---|---|---|
System.String | bitString | The bit-string. |
System.Int32 | numberOfUnusedBits | The number of unused bits. |
Returns
Type | Description |
---|---|
System.Byte[] |
BytesToBitString(Byte[])
Converts bytes to a bit-string.
Declaration
public static string BytesToBitString(byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytes | The bytes. |
Returns
Type | Description |
---|---|
System.String |
BytesToBitString(Byte[], Int32, Int32)
Converts bytes to a bit-string.
Declaration
public static string BytesToBitString(byte[] bytes, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytes | The bytes. |
System.Int32 | offset | The offset. |
System.Int32 | length | The length. |
Returns
Type | Description |
---|---|
System.String |
BytesToBitString(Byte[], Int32, Int32, Int32)
Converts bytes to a bit-string.
Declaration
public static string BytesToBitString(byte[] bytes, int offset, int length, int numberOfUnusedBits)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytes | The bytes. |
System.Int32 | offset | The offset. |
System.Int32 | length | The length. |
System.Int32 | numberOfUnusedBits | The number of unused bits. |
Returns
Type | Description |
---|---|
System.String |
BytesToBitString(Byte[], Int32, Int32, Int32, Boolean)
Converts bytes to a bit-string.
Declaration
public static string BytesToBitString(byte[] bytes, int offset, int length, int numberOfUnusedBits, bool trimLeft)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytes | The bytes. |
System.Int32 | offset | The offset. |
System.Int32 | length | The length. |
System.Int32 | numberOfUnusedBits | The number of unused bits. |
System.Boolean | trimLeft | Whether to trim unused bits from the left. |
Returns
Type | Description |
---|---|
System.String |
Deinterleave(Byte[], Byte[])
Deinterleaves a byte array i.e. XYXYXYXY to XXXXYYYY
Declaration
public static void Deinterleave(byte[] inputFrame, byte[] outputFrame)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | inputFrame | The inputFrame. |
System.Byte[] | outputFrame | The outputFrame. |
Deinterleave(Byte[], Byte[], Int32, Int32)
Deinterleaves a byte array i.e. XYXYXYXY to XXXXYYYY
Declaration
public static void Deinterleave(byte[] inputFrame, byte[] outputFrame, int start, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | inputFrame | The inputFrame. |
System.Byte[] | outputFrame | The outputFrame. |
System.Int32 | start | The start. |
System.Int32 | length | The length. |
Deinterleave(Byte[], Byte[], Int32, Int32, Boolean)
Deinterleaves a byte array
Declaration
public static void Deinterleave(byte[] inputFrame, byte[] outputFrame, int start, int length, bool reversePlanes)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | inputFrame | The inputFrame. |
System.Byte[] | outputFrame | The outputFrame. |
System.Int32 | start | The start. |
System.Int32 | length | The length. |
System.Boolean | reversePlanes | The reversePlanes. |
DeinterleaveTransform(Byte[], Byte[], Int32, Int32, Int32, Int32)
Deinterleave and transform (rotate) a byte array containing two planes
Declaration
public static void DeinterleaveTransform(byte[] inputFrame, byte[] outputFrame, int width, int height, int stride, int rotation)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | inputFrame | The inputFrame. |
System.Byte[] | outputFrame | The outputFrame. |
System.Int32 | width | The width. |
System.Int32 | height | The height. |
System.Int32 | stride | The stride. |
System.Int32 | rotation | Values 0, 90, 180, 270. |
DeinterleaveTransform(Byte[], Byte[], Int32, Int32, Int32, Int32, Int32)
Deinterleave and transform (rotate) a byte array containing two planes
Declaration
public static void DeinterleaveTransform(byte[] inputFrame, byte[] outputFrame, int width, int height, int stride, int rotation, int start)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | inputFrame | The inputFrame. |
System.Byte[] | outputFrame | The outputFrame. |
System.Int32 | width | The width. |
System.Int32 | height | The height. |
System.Int32 | stride | The stride. |
System.Int32 | rotation | Values 0, 90, 180, 270. |
System.Int32 | start | The start. |
DeinterleaveTransform(Byte[], Byte[], Int32, Int32, Int32, Int32, Int32, Boolean)
Deinterleave and transform (rotate) a byte array containing two planes
Declaration
public static void DeinterleaveTransform(byte[] inputFrame, byte[] outputFrame, int width, int height, int stride, int rotation, int start, bool reversePlanes)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | inputFrame | The inputFrame. |
System.Byte[] | outputFrame | The outputFrame. |
System.Int32 | width | The width. |
System.Int32 | height | The height. |
System.Int32 | stride | The stride. |
System.Int32 | rotation | Values 0, 90, 180, 270. |
System.Int32 | start | The start. |
System.Boolean | reversePlanes | Reverse output plane order. |
FromBytes1(Byte[], Int32, Int32)
Reads a 1-bit value from a byte array.
Declaration
public static bool FromBytes1(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Boolean | The value. |
FromBytes10(Byte[], Int32, Int32)
Reads a 10-bit value from a byte array.
Declaration
public static int FromBytes10(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes11(Byte[], Int32, Int32)
Reads a 11-bit value from a byte array.
Declaration
public static int FromBytes11(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes12(Byte[], Int32, Int32)
Reads a 12-bit value from a byte array.
Declaration
public static int FromBytes12(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes13(Byte[], Int32, Int32)
Reads a 13-bit value from a byte array.
Declaration
public static int FromBytes13(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes14(Byte[], Int32, Int32)
Reads a 14-bit value from a byte array.
Declaration
public static int FromBytes14(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes15(Byte[], Int32, Int32)
Reads a 15-bit value from a byte array.
Declaration
public static int FromBytes15(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes16(Byte[], Int32, Boolean)
Reads a 16-bit value from a byte array.
Declaration
public static int FromBytes16(byte[] input, int inputIndex, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes17(Byte[], Int32, Int32)
Reads an 17-bit value from a byte array.
Declaration
public static int FromBytes17(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes18(Byte[], Int32, Int32)
Reads an 18-bit value from a byte array.
Declaration
public static int FromBytes18(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes19(Byte[], Int32, Int32)
Reads an 19-bit value from a byte array.
Declaration
public static int FromBytes19(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes2(Byte[], Int32, Int32)
Reads a 2-bit value from a byte array.
Declaration
public static int FromBytes2(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes20(Byte[], Int32, Int32)
Reads an 20-bit value from a byte array.
Declaration
public static int FromBytes20(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes21(Byte[], Int32, Int32)
Reads an 21-bit value from a byte array.
Declaration
public static int FromBytes21(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes22(Byte[], Int32, Int32)
Reads an 22-bit value from a byte array.
Declaration
public static int FromBytes22(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes23(Byte[], Int32, Int32)
Reads an 23-bit value from a byte array.
Declaration
public static int FromBytes23(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes24(Byte[], Int32, Boolean)
Reads a 24-bit value from a byte array.
Declaration
public static int FromBytes24(byte[] input, int inputIndex, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes3(Byte[], Int32, Int32)
Reads a 3-bit value from a byte array.
Declaration
public static int FromBytes3(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes32(Byte[], Int32, Boolean)
Reads a 32-bit value from a byte array.
Declaration
public static long FromBytes32(byte[] input, int inputIndex, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Int64 | The value. |
FromBytes4(Byte[], Int32, Int32)
Reads a 4-bit value from a byte array.
Declaration
public static int FromBytes4(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes40(Byte[], Int32, Boolean)
Reads a 40-bit value from a byte array.
Declaration
public static long FromBytes40(byte[] input, int inputIndex, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Int64 | The value. |
FromBytes48(Byte[], Int32, Boolean)
Reads a 48-bit value from a byte array.
Declaration
public static long FromBytes48(byte[] input, int inputIndex, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Int64 | The value. |
FromBytes5(Byte[], Int32, Int32)
Reads a 5-bit value from a byte array.
Declaration
public static int FromBytes5(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes56(Byte[], Int32, Boolean)
Reads a 56-bit value from a byte array.
Declaration
public static long FromBytes56(byte[] input, int inputIndex, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Int64 | The value. |
FromBytes6(Byte[], Int32, Int32)
Reads a 6-bit value from a byte array.
Declaration
public static int FromBytes6(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes64(Byte[], Int32, Boolean)
Reads a 64-bit value from a byte array.
Declaration
public static long FromBytes64(byte[] input, int inputIndex, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Int64 | The value. |
FromBytes7(Byte[], Int32, Int32)
Reads a 7-bit value from a byte array.
Declaration
public static int FromBytes7(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes8(Byte[], Int32)
Reads an 8-bit value from a byte array.
Declaration
public static int FromBytes8(byte[] input, int inputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
FromBytes9(Byte[], Int32, Int32)
Reads a 9-bit value from a byte array.
Declaration
public static int FromBytes9(byte[] input, int inputIndex, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
Interleave(Byte[], Byte[])
Interleaves a byte array i.e. XXXXYYYY to XYXYXYXY
Declaration
public static void Interleave(byte[] inputFrame, byte[] outputFrame)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | inputFrame | The inputFrame. |
System.Byte[] | outputFrame | The outputFrame. |
Interleave(Byte[], Byte[], Int32, Int32)
Interleaves a byte array i.e. XXXXYYYY to XYXYXYXY
Declaration
public static void Interleave(byte[] inputFrame, byte[] outputFrame, int start, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | inputFrame | The inputFrame. |
System.Byte[] | outputFrame | The outputFrame. |
System.Int32 | start | The start. |
System.Int32 | length | The length. |
Interleave(Byte[], Byte[], Int32, Int32, Boolean)
Interleaves a byte array i.e. XXXXYYYY to XYXYXYXY
Declaration
public static void Interleave(byte[] inputFrame, byte[] outputFrame, int start, int length, bool reversePlanes)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | inputFrame | The inputFrame. |
System.Byte[] | outputFrame | The outputFrame. |
System.Int32 | start | The start. |
System.Int32 | length | The length. |
System.Boolean | reversePlanes | XXXXYYYY to YXYXYXYX |
InterleaveTransform(Byte[], Byte[], Int32, Int32, Int32, Int32)
Interleave and transform (rotate) a byte array containing two planes
Declaration
public static void InterleaveTransform(byte[] inputFrame, byte[] outputFrame, int width, int height, int stride, int rotation)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | inputFrame | The inputFrame. |
System.Byte[] | outputFrame | The outputFrame. |
System.Int32 | width | The width. |
System.Int32 | height | The height. |
System.Int32 | stride | The stride. |
System.Int32 | rotation | Values 0, 90, 180, 270. |
InterleaveTransform(Byte[], Byte[], Int32, Int32, Int32, Int32, Int32)
Interleave and transform (rotate) a byte array containing two planes
Declaration
public static void InterleaveTransform(byte[] inputFrame, byte[] outputFrame, int width, int height, int stride, int rotation, int start)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | inputFrame | The inputFrame. |
System.Byte[] | outputFrame | The outputFrame. |
System.Int32 | width | The width. |
System.Int32 | height | The height. |
System.Int32 | stride | The stride. |
System.Int32 | rotation | Values 0, 90, 180, 270. |
System.Int32 | start | The start. |
InterleaveTransform(Byte[], Byte[], Int32, Int32, Int32, Int32, Int32, Boolean)
Interleave and transform (rotate) a byte array containing two planes
Declaration
public static void InterleaveTransform(byte[] inputFrame, byte[] outputFrame, int width, int height, int stride, int rotation, int start, bool reversePlanes)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | inputFrame | The inputFrame. |
System.Byte[] | outputFrame | The outputFrame. |
System.Int32 | width | The width. |
System.Int32 | height | The height. |
System.Int32 | stride | The stride. |
System.Int32 | rotation | Values 0, 90, 180, 270. |
System.Int32 | start | The start. |
System.Boolean | reversePlanes | Reverse output plane order. |
ToBytes1(Boolean, Int32)
Converts a 1-bit value to a byte array.
Declaration
public static byte[] ToBytes1(bool value, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes1(Boolean, Int32, Byte[], Int32)
Writes a 1-bit value to a byte array.
Declaration
public static byte[] ToBytes1(bool value, int bitOffset, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes10(Int32, Int32, Boolean)
Converts a 10-bit value to a byte array.
Declaration
public static byte[] ToBytes10(int value, int bitOffset, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes10(Int32, Int32, Boolean, Byte[], Int32)
Writes a 10-bit value to a byte array.
Declaration
public static byte[] ToBytes10(int value, int bitOffset, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes11(Int32, Int32, Boolean)
Converts a 11-bit value to a byte array.
Declaration
public static byte[] ToBytes11(int value, int bitOffset, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes11(Int32, Int32, Boolean, Byte[], Int32)
Writes a 11-bit value to a byte array.
Declaration
public static byte[] ToBytes11(int value, int bitOffset, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes12(Int32, Int32, Boolean)
Converts a 12-bit value to a byte array.
Declaration
public static byte[] ToBytes12(int value, int bitOffset, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes12(Int32, Int32, Boolean, Byte[], Int32)
Writes a 12-bit value to a byte array.
Declaration
public static byte[] ToBytes12(int value, int bitOffset, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes13(Int32, Int32, Boolean)
Converts a 13-bit value to a byte array.
Declaration
public static byte[] ToBytes13(int value, int bitOffset, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes13(Int32, Int32, Boolean, Byte[], Int32)
Writes a 13-bit value to a byte array.
Declaration
public static byte[] ToBytes13(int value, int bitOffset, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes14(Int32, Int32, Boolean)
Converts a 14-bit value to a byte array.
Declaration
public static byte[] ToBytes14(int value, int bitOffset, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes14(Int32, Int32, Boolean, Byte[], Int32)
Writes a 14-bit value to a byte array.
Declaration
public static byte[] ToBytes14(int value, int bitOffset, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes15(Int32, Int32, Boolean)
Converts a 15-bit value to a byte array.
Declaration
public static byte[] ToBytes15(int value, int bitOffset, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes15(Int32, Int32, Boolean, Byte[], Int32)
Writes a 15-bit value to a byte array.
Declaration
public static byte[] ToBytes15(int value, int bitOffset, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes16(Int32, Boolean)
Converts a 16-bit value to a byte array.
Declaration
public static byte[] ToBytes16(int value, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes16(Int32, Boolean, Byte[], Int32)
Writes a 16-bit value to a byte array.
Declaration
public static byte[] ToBytes16(int value, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes17(Int32, Int32, Boolean)
Converts a 17-bit value to a byte array.
Declaration
public static byte[] ToBytes17(int value, int bitOffset, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes17(Int32, Int32, Boolean, Byte[], Int32)
Writes a 17-bit value to a byte array.
Declaration
public static byte[] ToBytes17(int value, int bitOffset, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes18(Int32, Int32, Boolean)
Converts an 18-bit value to a byte array.
Declaration
public static byte[] ToBytes18(int value, int bitOffset, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes18(Int32, Int32, Boolean, Byte[], Int32)
Writes an 18-bit value to a byte array.
Declaration
public static byte[] ToBytes18(int value, int bitOffset, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes19(Int32, Int32, Boolean)
Converts a 19-bit value to a byte array.
Declaration
public static byte[] ToBytes19(int value, int bitOffset, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes19(Int32, Int32, Boolean, Byte[], Int32)
Writes a 19-bit value to a byte array.
Declaration
public static byte[] ToBytes19(int value, int bitOffset, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes2(Int32, Int32)
Converts a 2-bit value to a byte array.
Declaration
public static byte[] ToBytes2(int value, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes2(Int32, Int32, Byte[], Int32)
Writes a 2-bit value to a byte array.
Declaration
public static byte[] ToBytes2(int value, int bitOffset, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes20(Int32, Int32, Boolean)
Converts a 20-bit value to a byte array.
Declaration
public static byte[] ToBytes20(int value, int bitOffset, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes20(Int32, Int32, Boolean, Byte[], Int32)
Writes a 20-bit value to a byte array.
Declaration
public static byte[] ToBytes20(int value, int bitOffset, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes21(Int32, Int32, Boolean)
Converts a 21-bit value to a byte array.
Declaration
public static byte[] ToBytes21(int value, int bitOffset, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes21(Int32, Int32, Boolean, Byte[], Int32)
Writes a 21-bit value to a byte array.
Declaration
public static byte[] ToBytes21(int value, int bitOffset, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes22(Int32, Int32, Boolean)
Converts a 22-bit value to a byte array.
Declaration
public static byte[] ToBytes22(int value, int bitOffset, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes22(Int32, Int32, Boolean, Byte[], Int32)
Writes a 22-bit value to a byte array.
Declaration
public static byte[] ToBytes22(int value, int bitOffset, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes23(Int32, Int32, Boolean)
Converts a 23-bit value to a byte array.
Declaration
public static byte[] ToBytes23(int value, int bitOffset, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes23(Int32, Int32, Boolean, Byte[], Int32)
Writes a 23-bit value to a byte array.
Declaration
public static byte[] ToBytes23(int value, int bitOffset, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes24(Int32, Boolean)
Converts a 24-bit value to a byte array.
Declaration
public static byte[] ToBytes24(int value, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes24(Int32, Boolean, Byte[], Int32)
Writes a 24-bit value to a byte array.
Declaration
public static byte[] ToBytes24(int value, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes3(Int32, Int32)
Converts a 3-bit value to a byte array.
Declaration
public static byte[] ToBytes3(int value, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes3(Int32, Int32, Byte[], Int32)
Writes a 3-bit value to a byte array.
Declaration
public static byte[] ToBytes3(int value, int bitOffset, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes32(Int64, Boolean)
Converts a 32-bit value to a byte array.
Declaration
public static byte[] ToBytes32(long value, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value to write. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes32(Int64, Boolean, Byte[], Int32)
Writes a 32-bit value to a byte array.
Declaration
public static byte[] ToBytes32(long value, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value to write. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes4(Int32, Int32)
Converts a 4-bit value to a byte array.
Declaration
public static byte[] ToBytes4(int value, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes4(Int32, Int32, Byte[], Int32)
Writes a 4-bit value to a byte array.
Declaration
public static byte[] ToBytes4(int value, int bitOffset, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes40(Int64, Boolean)
Converts a 40-bit value to a byte array.
Declaration
public static byte[] ToBytes40(long value, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value to write. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes40(Int64, Boolean, Byte[], Int32)
Writes a 40-bit value to a byte array.
Declaration
public static byte[] ToBytes40(long value, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value to write. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes48(Int64, Boolean)
Converts a 48-bit value to a byte array.
Declaration
public static byte[] ToBytes48(long value, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value to write. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes48(Int64, Boolean, Byte[], Int32)
Writes a 48-bit value to a byte array.
Declaration
public static byte[] ToBytes48(long value, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value to write. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes5(Int32, Int32)
Converts a 5-bit value to a byte array.
Declaration
public static byte[] ToBytes5(int value, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes5(Int32, Int32, Byte[], Int32)
Writes a 5-bit value to a byte array.
Declaration
public static byte[] ToBytes5(int value, int bitOffset, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes56(Int64, Boolean)
Converts a 56-bit value to a byte array.
Declaration
public static byte[] ToBytes56(long value, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value to write. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes56(Int64, Boolean, Byte[], Int32)
Writes a 56-bit value to a byte array.
Declaration
public static byte[] ToBytes56(long value, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value to write. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes6(Int32, Int32)
Converts a 6-bit value to a byte array.
Declaration
public static byte[] ToBytes6(int value, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes6(Int32, Int32, Byte[], Int32)
Writes a 6-bit value to a byte array.
Declaration
public static byte[] ToBytes6(int value, int bitOffset, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes64(Int64, Boolean)
Converts a 64-bit value to a byte array.
Declaration
public static byte[] ToBytes64(long value, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value to write. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes64(Int64, Boolean, Byte[], Int32)
Writes a 64-bit value to a byte array.
Declaration
public static byte[] ToBytes64(long value, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value to write. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes7(Int32, Int32)
Converts a 7-bit value to a byte array.
Declaration
public static byte[] ToBytes7(int value, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes7(Int32, Int32, Byte[], Int32)
Writes a 7-bit value to a byte array.
Declaration
public static byte[] ToBytes7(int value, int bitOffset, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes8(Int32)
Converts an 8-bit value to a byte array.
Declaration
public static byte[] ToBytes8(int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes8(Int32, Byte[], Int32)
Writes an 8-bit value to a byte array.
Declaration
public static byte[] ToBytes8(int value, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes9(Int32, Int32, Boolean)
Converts a 9-bit value to a byte array.
Declaration
public static byte[] ToBytes9(int value, int bitOffset, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
ToBytes9(Int32, Int32, Boolean, Byte[], Int32)
Writes a 9-bit value to a byte array.
Declaration
public static byte[] ToBytes9(int value, int bitOffset, bool littleEndian, byte[] output, int outputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to write. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Byte[] | output | The output byte array. |
System.Int32 | outputIndex | The index to start writing. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
Transform(Byte[], Byte[], Int32, Int32, Int32, Int32)
Transforms a byte containing a 2D plane (rotates 90, 180, 270)
Declaration
public static void Transform(byte[] inputFrame, byte[] outputFrame, int width, int height, int stride, int rotation)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | inputFrame | The inputFrame. |
System.Byte[] | outputFrame | The outputFrame. |
System.Int32 | width | The width. |
System.Int32 | height | The height. |
System.Int32 | stride | The stride. |
System.Int32 | rotation | The rotation. |
Transform(Byte[], Byte[], Int32, Int32, Int32, Int32, Int32)
Transforms a byte containing a 2D plane (rotates 90, 180, 270)
Declaration
public static void Transform(byte[] inputFrame, byte[] outputFrame, int width, int height, int stride, int rotation, int start)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | inputFrame | The inputFrame. |
System.Byte[] | outputFrame | The outputFrame. |
System.Int32 | width | The width. |
System.Int32 | height | The height. |
System.Int32 | stride | The stride. |
System.Int32 | rotation | The rotation. |
System.Int32 | start | Start position for both input and output frame |
Transform(Byte[], Byte[], Int32, Int32, Int32, Int32, Int32, Int32)
Transforms a byte containing a 2D plane (rotates 90, 180, 270)
Declaration
public static void Transform(byte[] inputFrame, byte[] outputFrame, int width, int height, int stride, int rotation, int inputStart, int outputStart)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | inputFrame | The inputFrame. |
System.Byte[] | outputFrame | The outputFrame. |
System.Int32 | width | The width. |
System.Int32 | height | The height. |
System.Int32 | stride | The stride. |
System.Int32 | rotation | The rotation. |
System.Int32 | inputStart | The inputStart. |
System.Int32 | outputStart | The outputStart. |
Transform(Byte[], Byte[], Int32, Int32, Int32, Int32, Int32, Int32, Int32)
Transforms a byte containing a 2D plane (rotates 90, 180, 270). When transforming interleaved planes. Set the chunkLength to the number of planes.
Declaration
public static void Transform(byte[] inputFrame, byte[] outputFrame, int width, int height, int stride, int rotation, int inputStart, int outputStart, int chunkLength)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | inputFrame | The inputFrame. |
System.Byte[] | outputFrame | The outputFrame. |
System.Int32 | width | The width. |
System.Int32 | height | The height. |
System.Int32 | stride | The stride. |
System.Int32 | rotation | The rotation. |
System.Int32 | inputStart | The inputStart. |
System.Int32 | outputStart | The outputStart. |
System.Int32 | chunkLength | The chunkLength. |
TryFromBytes1(Byte[], Int32, Int32, out Boolean)
Tries to read a 1-bit value from a byte array.
Declaration
public static bool TryFromBytes1(byte[] input, int inputIndex, int bitOffset, out bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Boolean | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes10(Byte[], Int32, Int32, out Int32)
Tries to read a 10-bit value from a byte array.
Declaration
public static bool TryFromBytes10(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes11(Byte[], Int32, Int32, out Int32)
Tries to read a 11-bit value from a byte array.
Declaration
public static bool TryFromBytes11(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes12(Byte[], Int32, Int32, out Int32)
Tries to read a 12-bit value from a byte array.
Declaration
public static bool TryFromBytes12(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes13(Byte[], Int32, Int32, out Int32)
Tries to read a 13-bit value from a byte array.
Declaration
public static bool TryFromBytes13(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes14(Byte[], Int32, Int32, out Int32)
Tries to read a 14-bit value from a byte array.
Declaration
public static bool TryFromBytes14(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes15(Byte[], Int32, Int32, out Int32)
Tries to read a 15-bit value from a byte array.
Declaration
public static bool TryFromBytes15(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes16(Byte[], Int32, Boolean, out Int32)
Tries to read a 16-bit value from a byte array.
Declaration
public static bool TryFromBytes16(byte[] input, int inputIndex, bool littleEndian, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes17(Byte[], Int32, Int32, out Int32)
Tries to read a 17-bit value from a byte array.
Declaration
public static bool TryFromBytes17(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes18(Byte[], Int32, Int32, out Int32)
Tries to read a 18-bit value from a byte array.
Declaration
public static bool TryFromBytes18(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes19(Byte[], Int32, Int32, out Int32)
Tries to read a 19-bit value from a byte array.
Declaration
public static bool TryFromBytes19(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes2(Byte[], Int32, Int32, out Int32)
Tries to read a 2-bit value from a byte array.
Declaration
public static bool TryFromBytes2(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes20(Byte[], Int32, Int32, out Int32)
Tries to read a 20-bit value from a byte array.
Declaration
public static bool TryFromBytes20(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes21(Byte[], Int32, Int32, out Int32)
Tries to read a 21-bit value from a byte array.
Declaration
public static bool TryFromBytes21(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes22(Byte[], Int32, Int32, out Int32)
Tries to read a 22-bit value from a byte array.
Declaration
public static bool TryFromBytes22(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes23(Byte[], Int32, Int32, out Int32)
Tries to read a 23-bit value from a byte array.
Declaration
public static bool TryFromBytes23(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes24(Byte[], Int32, Boolean, out Int32)
Tries to read a 24-bit value from a byte array.
Declaration
public static bool TryFromBytes24(byte[] input, int inputIndex, bool littleEndian, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes3(Byte[], Int32, Int32, out Int32)
Tries to read a 3-bit value from a byte array.
Declaration
public static bool TryFromBytes3(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes32(Byte[], Int32, Boolean, out Int64)
Tries to read a 32-bit value from a byte array.
Declaration
public static bool TryFromBytes32(byte[] input, int inputIndex, bool littleEndian, out long value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Int64 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes4(Byte[], Int32, Int32, out Int32)
Tries to read a 4-bit value from a byte array.
Declaration
public static bool TryFromBytes4(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes40(Byte[], Int32, Boolean, out Int64)
Tries to read a 40-bit value from a byte array.
Declaration
public static bool TryFromBytes40(byte[] input, int inputIndex, bool littleEndian, out long value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Int64 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes48(Byte[], Int32, Boolean, out Int64)
Tries to read a 48-bit value from a byte array.
Declaration
public static bool TryFromBytes48(byte[] input, int inputIndex, bool littleEndian, out long value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Int64 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes5(Byte[], Int32, Int32, out Int32)
Tries to read a 5-bit value from a byte array.
Declaration
public static bool TryFromBytes5(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes56(Byte[], Int32, Boolean, out Int64)
Tries to read a 56-bit value from a byte array.
Declaration
public static bool TryFromBytes56(byte[] input, int inputIndex, bool littleEndian, out long value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Int64 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes6(Byte[], Int32, Int32, out Int32)
Tries to read a 6-bit value from a byte array.
Declaration
public static bool TryFromBytes6(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes64(Byte[], Int32, Boolean, out Int64)
Tries to read a 64-bit value from a byte array.
Declaration
public static bool TryFromBytes64(byte[] input, int inputIndex, bool littleEndian, out long value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Boolean | littleEndian | Whether to use little-endian format. |
System.Int64 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes7(Byte[], Int32, Int32, out Int32)
Tries to read a 7-bit value from a byte array.
Declaration
public static bool TryFromBytes7(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes8(Byte[], Int32, out Int32)
Tries to read an 8-bit value from a byte array.
Declaration
public static bool TryFromBytes8(byte[] input, int inputIndex, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryFromBytes9(Byte[], Int32, Int32, out Int32)
Tries to read a 9-bit value from a byte array.
Declaration
public static bool TryFromBytes9(byte[] input, int inputIndex, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | inputIndex | The index to start reading. |
System.Int32 | bitOffset | The offset of the value within the byte. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|