Class DataBuffer
Binary data buffer implementation
Inherited Members
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class DataBuffer
Properties
Data
Gets the data.
Declaration
public virtual byte[] Data { get; }
Property Value
Type | Description |
---|---|
System.Byte[] |
Empty
Gets an empty data buffer.
Declaration
public static DataBuffer Empty { get; }
Property Value
Type | Description |
---|---|
DataBuffer |
Index
Gets or sets the index.
Declaration
public int Index { get; protected set; }
Property Value
Type | Description |
---|---|
System.Int32 |
InnerData
Gets or sets backing data buffer.
Declaration
protected byte[] InnerData { get; set; }
Property Value
Type | Description |
---|---|
System.Byte[] |
IsPooled
Gets whether this DataBuffer is from a pool.
Declaration
public virtual bool IsPooled { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsSubset
Gets whether this DataBuffer is a subset.
Declaration
public virtual bool IsSubset { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Length
Gets or sets the length.
Declaration
public int Length { get; protected set; }
Property Value
Type | Description |
---|---|
System.Int32 |
LittleEndian
Gets or sets whether Data is little-endian.
Declaration
public bool LittleEndian { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
Allocate(Int32)
Allocates a new data buffer with a given size (in bytes) in big-endian format.
Declaration
public static DataBuffer Allocate(int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | count | Pre-allocated data buffer size (in bytes). |
Returns
Type | Description |
---|---|
DataBuffer |
Allocate(Int32, Boolean)
Allocates a new data buffer with a given size (in bytes).
Declaration
public static DataBuffer Allocate(int count, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | count | Pre-allocated data buffer size (in bytes). |
System.Boolean | littleEndian | Whether the data is little-endian. |
Returns
Type | Description |
---|---|
DataBuffer |
And(Int32, Int32)
Performs a bitwise "and" operation on a value.
Declaration
public bool And(int value, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Append(DataBuffer)
Appends a buffer.
Declaration
public virtual DataBuffer Append(DataBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | buffer | The buffer. |
Returns
Type | Description |
---|---|
DataBuffer |
Append(DataBuffer[])
Appends some buffers.
Declaration
public virtual DataBuffer Append(DataBuffer[] buffers)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer[] | buffers | The buffers. |
Returns
Type | Description |
---|---|
DataBuffer |
AreEqual(DataBuffer, DataBuffer)
Tests if the two buffers have equal contents.
Declaration
public static bool AreEqual(DataBuffer buffer1, DataBuffer buffer2)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | buffer1 | First buffer to test. |
DataBuffer | buffer2 | Second buffer to test. |
Returns
Type | Description |
---|---|
System.Boolean |
CanResize(Int32, Int32)
Gets whether this buffer can be resized to the new length.
Declaration
public bool CanResize(int newLength, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | newLength | The new length. |
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Clone()
Clones this instance.
Declaration
public DataBuffer Clone()
Returns
Type | Description |
---|---|
DataBuffer |
Clone(Boolean)
Clones this instance.
Declaration
public DataBuffer Clone(bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | littleEndian | Whether to clone into a little endian buffer. |
Returns
Type | Description |
---|---|
DataBuffer |
Copy()
Copies this instance into new memory.
Declaration
public DataBuffer Copy()
Returns
Type | Description |
---|---|
DataBuffer |
Copy(Boolean)
Copies this instance.
Declaration
public DataBuffer Copy(bool usePool)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | usePool |
Returns
Type | Description |
---|---|
DataBuffer |
Free()
Decrements the retain count by one and returns the Buffer to the pool if zero.
Declaration
public virtual DataBuffer Free()
Returns
Type | Description |
---|---|
DataBuffer |
FromBytes(Byte[])
Creates an instance from an array of bytes.
Declaration
public static DataBuffer FromBytes(byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytes |
Returns
Type | Description |
---|---|
DataBuffer |
FromBytes(Byte[], Boolean)
Creates an instance from an array of bytes.
Declaration
public static DataBuffer FromBytes(byte[] bytes, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytes | |
System.Boolean | littleEndian |
Returns
Type | Description |
---|---|
DataBuffer |
FromHexString(String)
Creates an instance from a hexadecimal string.
Declaration
public static DataBuffer FromHexString(string hexString)
Parameters
Type | Name | Description |
---|---|---|
System.String | hexString |
Returns
Type | Description |
---|---|
DataBuffer |
FromHexString(String, Boolean)
Creates an instance from a hexadecimal string.
Declaration
public static DataBuffer FromHexString(string hexString, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.String | hexString | |
System.Boolean | littleEndian |
Returns
Type | Description |
---|---|
DataBuffer |
FromJson(String)
Deserializes an instance from JSON.
Declaration
public static DataBuffer FromJson(string dataBufferJson)
Parameters
Type | Name | Description |
---|---|---|
System.String | dataBufferJson | The data buffer JSON. |
Returns
Type | Description |
---|---|
DataBuffer |
FromJsonArray(String)
Deserializes an array of instances from JSON.
Declaration
public static DataBuffer[] FromJsonArray(string dataBuffersJson)
Parameters
Type | Name | Description |
---|---|---|
System.String | dataBuffersJson | The data buffers JSON. |
Returns
Type | Description |
---|---|
DataBuffer[] |
Keep()
Increment the retain count by one.
Declaration
public virtual DataBuffer Keep()
Returns
Type | Description |
---|---|
DataBuffer |
Or(Int32, Int32)
Performs a bitwise "or" operation on a value.
Declaration
public bool Or(int value, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Prepend(DataBuffer)
Prepends a buffer.
Declaration
public virtual DataBuffer Prepend(DataBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | buffer | The buffer. |
Returns
Type | Description |
---|---|
DataBuffer |
Prepend(DataBuffer[])
Prepends some buffers.
Declaration
public virtual void Prepend(DataBuffer[] buffers)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer[] | buffers | The buffers. |
Read1(Int32, Int32)
Reads a 1-bit value.
Declaration
public bool Read1(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Read10(Int32, Int32)
Reads a 10-bit value.
Declaration
public int Read10(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bitoffset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read10Signed(Int32, Int32)
Reads a 10-bit signed value.
Declaration
public int Read10Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read11(Int32, Int32)
Reads a 11-bit value.
Declaration
public int Read11(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bitoffset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read11Signed(Int32, Int32)
Reads a 11-bit signed value.
Declaration
public int Read11Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read12(Int32, Int32)
Reads a 12-bit value.
Declaration
public int Read12(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bitoffset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read12Signed(Int32, Int32)
Reads a 12-bit signed value.
Declaration
public int Read12Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read13(Int32, Int32)
Reads a 13-bit value.
Declaration
public int Read13(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bitoffset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read13Signed(Int32, Int32)
Reads a 13-bit signed value.
Declaration
public int Read13Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read14(Int32, Int32)
Reads a 14-bit value.
Declaration
public int Read14(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read14Signed(Int32, Int32)
Reads a 14-bit signed value.
Declaration
public int Read14Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read15(Int32, Int32)
Reads a 15-bit value.
Declaration
public int Read15(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read15Signed(Int32, Int32)
Reads a 15-bit signed value.
Declaration
public int Read15Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read16(Int32)
Reads a 16-bit value.
Declaration
public int Read16(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read16(Int32, out Int32)
Reads a 16-bit value.
Declaration
public int Read16(int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Int32 |
Read16Signed(Int32)
Reads a 16-bit signed value.
Declaration
public int Read16Signed(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read16Signed(Int32, out Int32)
Reads a 16-bit signed value.
Declaration
public int Read16Signed(int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Int32 |
Read17(Int32, Int32)
Reads a 17-bit value.
Declaration
public int Read17(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read17Signed(Int32, Int32)
Reads a 17-bit signed value.
Declaration
public int Read17Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read18(Int32, Int32)
Reads an 18-bit value.
Declaration
public int Read18(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read18Signed(Int32, Int32)
Reads an 18-bit signed value.
Declaration
public int Read18Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read19(Int32, Int32)
Reads a 19-bit value.
Declaration
public int Read19(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read19Signed(Int32, Int32)
Reads a 19-bit signed value.
Declaration
public int Read19Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read2(Int32, Int32)
Reads a 2-bit value.
Declaration
public int Read2(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read20(Int32, Int32)
Reads a 20-bit value.
Declaration
public int Read20(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read20Signed(Int32, Int32)
Reads a 20-bit signed value.
Declaration
public int Read20Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read21(Int32, Int32)
Reads a 21-bit value.
Declaration
public int Read21(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read21Signed(Int32, Int32)
Reads a 21-bit signed value.
Declaration
public int Read21Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read22(Int32, Int32)
Reads a 22-bit value.
Declaration
public int Read22(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read22Signed(Int32, Int32)
Reads a 22-bit signed value.
Declaration
public int Read22Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read23(Int32, Int32)
Reads a 23-bit value.
Declaration
public int Read23(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read23Signed(Int32, Int32)
Reads a 23-bit signed value.
Declaration
public int Read23Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read24(Int32)
Reads a 24-bit value.
Declaration
public int Read24(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read24(Int32, out Int32)
Reads a 24-bit value.
Declaration
public int Read24(int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Int32 |
Read24Signed(Int32)
Reads a 24-bit signed value.
Declaration
public int Read24Signed(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read24Signed(Int32, out Int32)
Reads a 24-bit signed value.
Declaration
public int Read24Signed(int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Int32 |
Read2Signed(Int32, Int32)
Reads a 2-bit signed value.
Declaration
public int Read2Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read3(Int32, Int32)
Reads a 3-bit value.
Declaration
public int Read3(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read32(Int32)
Reads a 32-bit value.
Declaration
public long Read32(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Int64 |
Read32(Int32, out Int32)
Reads a 32-bit value.
Declaration
public long Read32(int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Int64 |
Read32Signed(Int32)
Reads a 32-bit signed value.
Declaration
public long Read32Signed(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Int64 |
Read32Signed(Int32, out Int32)
Reads a 32-bit signed value.
Declaration
public long Read32Signed(int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Int64 |
Read3Signed(Int32, Int32)
Reads a 3-bit signed value.
Declaration
public int Read3Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read4(Int32, Int32)
Reads a 4-bit value.
Declaration
public int Read4(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read40(Int32)
Reads a 40-bit value.
Declaration
public long Read40(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Int64 |
Read40(Int32, out Int32)
Reads a 40-bit value.
Declaration
public long Read40(int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Int64 |
Read40Signed(Int32)
Reads a 40-bit signed value.
Declaration
public long Read40Signed(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Int64 |
Read40Signed(Int32, out Int32)
Reads a 40-bit signed value.
Declaration
public long Read40Signed(int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Int64 |
Read48(Int32)
Reads a 48-bit value.
Declaration
public long Read48(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Int64 |
Read48(Int32, out Int32)
Reads a 48-bit value.
Declaration
public long Read48(int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Int64 |
Read48Signed(Int32)
Reads a 48-bit signed value.
Declaration
public long Read48Signed(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Int64 |
Read48Signed(Int32, out Int32)
Reads a 48-bit signed value.
Declaration
public long Read48Signed(int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Int64 |
Read4Signed(Int32, Int32)
Reads a 4-bit signed value.
Declaration
public int Read4Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read5(Int32, Int32)
Reads a 5-bit value.
Declaration
public int Read5(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read56(Int32)
Reads a 56-bit value.
Declaration
public long Read56(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Int64 |
Read56(Int32, out Int32)
Reads a 56-bit value.
Declaration
public long Read56(int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Int64 |
Read56Signed(Int32)
Reads a 56-bit signed value.
Declaration
public long Read56Signed(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Int64 |
Read56Signed(Int32, out Int32)
Reads a 56-bit signed value.
Declaration
public long Read56Signed(int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Int64 |
Read5Signed(Int32, Int32)
Reads a 5-bit signed value.
Declaration
public int Read5Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read6(Int32, Int32)
Reads a 6-bit value.
Declaration
public int Read6(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read64(Int32)
Reads a 64-bit value.
Declaration
public long Read64(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Int64 |
Read64(Int32, out Int32)
Reads a 64-bit value.
Declaration
public long Read64(int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Int64 |
Read64Signed(Int32)
Reads a 64-bit signed value.
Declaration
public long Read64Signed(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Int64 |
Read64Signed(Int32, out Int32)
Reads a 64-bit signed value.
Declaration
public long Read64Signed(int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Int64 |
Read6Signed(Int32, Int32)
Reads a 6-bit signed value.
Declaration
public int Read6Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read7(Int32, Int32)
Reads a 7-bit value.
Declaration
public int Read7(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read7Signed(Int32, Int32)
Reads a 7-bit signed value.
Declaration
public int Read7Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read8(Int32)
Reads an 8-bit value.
Declaration
public int Read8(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read8(Int32, out Int32)
Reads an 8-bit value.
Declaration
public int Read8(int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Int32 |
Read8Signed(Int32)
Reads an 8-bit signed value.
Declaration
public int Read8Signed(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read8Signed(Int32, out Int32)
Reads an 8-bit signed value.
Declaration
public int Read8Signed(int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Int32 |
Read9(Int32, Int32)
Reads a 9-bit value.
Declaration
public int Read9(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bitoffset. |
Returns
Type | Description |
---|---|
System.Int32 |
Read9Signed(Int32, Int32)
Reads a 9-bit signed value.
Declaration
public int Read9Signed(int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Int32 |
ReadUtf8String(Int32)
Read a UTF-8 string.
Declaration
public string ReadUtf8String(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.String |
ReadUtf8String(Int32, Int32)
Reads a UTF-8 string.
Declaration
public string ReadUtf8String(int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | length | The length. |
Returns
Type | Description |
---|---|
System.String |
Resize(Int32)
Resizes this buffer to a new length with new data being inserted at the end.
Declaration
public virtual void Resize(int newLength)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | newLength | The new length. |
Resize(Int32, Int32)
Resizes this buffer to a new length with new data being inserted at a given offset.
Declaration
public virtual void Resize(int newLength, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | newLength | The new length. |
System.Int32 | offset | The offset. |
Resize(Int32, Int32, Boolean)
Resizes this buffer to a new length with new data being inserted at a given offset.
Declaration
public virtual void Resize(int newLength, int offset, bool setZero)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | newLength | The new length. |
System.Int32 | offset | The offset. |
System.Boolean | setZero | Sets empty space to zero. |
SequenceEquals(DataBuffer)
Compares a data buffer for equality.
Declaration
public bool SequenceEquals(DataBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | buffer | The data buffer. |
Returns
Type | Description |
---|---|
System.Boolean |
|
SequenceEqualsConstantTime(DataBuffer)
Compares a data buffer for equality in constant time.
Declaration
public bool SequenceEqualsConstantTime(DataBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | buffer | The buffer. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Set(Byte)
Sets the data buffer to the specified value.
Declaration
public void Set(byte value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | value | The value. |
Set(Byte, Int32)
Sets a subset of the data buffer to the specified value.
Declaration
public void Set(byte value, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | value | The value. |
System.Int32 | offset | The offset. |
Set(Byte, Int32, Int32)
Sets a subset of the data buffer to the specified value.
Declaration
public void Set(byte value, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | length | The length. |
Subset(Int32)
Gets a subset of this instance.
Declaration
public virtual DataBuffer Subset(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
DataBuffer |
Subset(Int32, Int32)
Gets a subset of this instance.
Declaration
public virtual DataBuffer Subset(int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | length | The length. |
Returns
Type | Description |
---|---|
DataBuffer |
ToArray()
Converts this instance to an array of bytes.
Declaration
public byte[] ToArray()
Returns
Type | Description |
---|---|
System.Byte[] |
ToBytes()
Converts this instance to an array of bytes.
Declaration
public byte[] ToBytes()
Returns
Type | Description |
---|---|
System.Byte[] |
ToHexString()
Converts this instance to a hexadecimal string.
Declaration
public string ToHexString()
Returns
Type | Description |
---|---|
System.String |
ToJson()
Serializes this instance to JSON.
Declaration
public string ToJson()
Returns
Type | Description |
---|---|
System.String |
ToJson(DataBuffer)
Serializes an instance to JSON.
Declaration
public static string ToJson(DataBuffer dataBuffer)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | dataBuffer | The data buffer. |
Returns
Type | Description |
---|---|
System.String |
ToJsonArray(DataBuffer[])
Serializes an array of instances to JSON.
Declaration
public static string ToJsonArray(DataBuffer[] dataBuffers)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer[] | dataBuffers | The data buffers. |
Returns
Type | Description |
---|---|
System.String |
TryKeep()
Attempts to increment the retain count by one.
Declaration
public bool TryKeep()
Returns
Type | Description |
---|---|
System.Boolean | True if successful. |
TryRead1(Int32, Int32, out Boolean)
Tries to read a 1-bit value.
Declaration
public bool TryRead1(int offset, int bitOffset, out bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Boolean | value | if set to |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead10(Int32, Int32, out Int32)
Tries to read a 10-bit value.
Declaration
public bool TryRead10(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead11(Int32, Int32, out Int32)
Tries to read an 11-bit value.
Declaration
public bool TryRead11(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead12(Int32, Int32, out Int32)
Tries to read a 12-bit value.
Declaration
public bool TryRead12(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead13(Int32, Int32, out Int32)
Tries to read a 13-bit value.
Declaration
public bool TryRead13(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead14(Int32, Int32, out Int32)
Tries to read a 14-bit value.
Declaration
public bool TryRead14(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead15(Int32, Int32, out Int32)
Tries to read a 15-bit value.
Declaration
public bool TryRead15(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead16(Int32, out Int32)
Tries to read a 16-bit value.
Declaration
public bool TryRead16(int offset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead17(Int32, Int32, out Int32)
Tries to read a 17-bit value.
Declaration
public bool TryRead17(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead18(Int32, Int32, out Int32)
Tries to read an 18-bit value.
Declaration
public bool TryRead18(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead19(Int32, Int32, out Int32)
Tries to read a 19-bit value.
Declaration
public bool TryRead19(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead2(Int32, Int32, out Int32)
Tries to read a 2-bit value.
Declaration
public bool TryRead2(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead20(Int32, Int32, out Int32)
Tries to read a 20-bit value.
Declaration
public bool TryRead20(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead21(Int32, Int32, out Int32)
Tries to read a 21-bit value.
Declaration
public bool TryRead21(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead22(Int32, Int32, out Int32)
Tries to read a 22-bit value.
Declaration
public bool TryRead22(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead23(Int32, Int32, out Int32)
Tries to read a 23-bit value.
Declaration
public bool TryRead23(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead24(Int32, out Int32)
Tries to read a 24-bit value.
Declaration
public bool TryRead24(int offset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead3(Int32, Int32, out Int32)
Tries to read a 3-bit value.
Declaration
public bool TryRead3(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead32(Int32, out Int64)
Tries to read a 32-bit value.
Declaration
public bool TryRead32(int offset, out long value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int64 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead4(Int32, Int32, out Int32)
Tries to read a 4-bit value.
Declaration
public bool TryRead4(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead40(Int32, out Int64)
Tries to read a 40-bit value.
Declaration
public bool TryRead40(int offset, out long value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int64 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead48(Int32, out Int64)
Tries to read a 48-bit value.
Declaration
public bool TryRead48(int offset, out long value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int64 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead5(Int32, Int32, out Int32)
Tries to read a 5-bit value.
Declaration
public bool TryRead5(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead56(Int32, out Int64)
Tries to read a 56-bit value.
Declaration
public bool TryRead56(int offset, out long value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int64 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead6(Int32, Int32, out Int32)
Tries to read a 6-bit value.
Declaration
public bool TryRead6(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead64(Int32, out Int64)
Tries to read a 64-bit value.
Declaration
public bool TryRead64(int offset, out long value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int64 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead7(Int32, Int32, out Int32)
Tries to read a 7-bit value.
Declaration
public bool TryRead7(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead8(Int32, out Int32)
Tries to read an 8-bit value.
Declaration
public bool TryRead8(int offset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
TryRead9(Int32, Int32, out Int32)
Tries to read a 9-bit value.
Declaration
public bool TryRead9(int offset, int bitOffset, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
Wrap(Byte[])
Produces a new data buffer containing supplied data in big-endian format.
Declaration
public static DataBuffer Wrap(byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The data. |
Returns
Type | Description |
---|---|
DataBuffer |
Wrap(Byte[], Boolean)
Produces a new data buffer containing supplied data.
Declaration
public static DataBuffer Wrap(byte[] data, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The data. |
System.Boolean | littleEndian | Whether the data is little-endian. |
Returns
Type | Description |
---|---|
DataBuffer |
Wrap(Byte[], Int32)
Produces a new data buffer containing supplied data in big-endian format.
Declaration
public static DataBuffer Wrap(byte[] data, int index)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The data. |
System.Int32 | index | The index. |
Returns
Type | Description |
---|---|
DataBuffer |
Wrap(Byte[], Int32, Boolean)
Produces a new data buffer containing supplied data.
Declaration
public static DataBuffer Wrap(byte[] data, int index, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The data. |
System.Int32 | index | The index. |
System.Boolean | littleEndian | Whether the data is little-endian. |
Returns
Type | Description |
---|---|
DataBuffer |
Wrap(Byte[], Int32, Int32)
Produces a new data buffer containing supplied data in big-endian format.
Declaration
public static DataBuffer Wrap(byte[] data, int index, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The data. |
System.Int32 | index | The index. |
System.Int32 | length | The length. |
Returns
Type | Description |
---|---|
DataBuffer |
Wrap(Byte[], Int32, Int32, Boolean)
Produces a new data buffer containing supplied data.
Declaration
public static DataBuffer Wrap(byte[] data, int index, int length, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The data. |
System.Int32 | index | The index. |
System.Int32 | length | The length. |
System.Boolean | littleEndian | Whether the data is little-endian. |
Returns
Type | Description |
---|---|
DataBuffer |
Write(DataBuffer)
Writes a data buffer to this instance.
Declaration
public void Write(DataBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | buffer | The buffer. |
Write(DataBuffer, Int32)
Writes a data buffer to this instance.
Declaration
public void Write(DataBuffer buffer, int offset)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | buffer | The buffer. |
System.Int32 | offset | The offset. |
Write(DataBuffer, Int32, out Int32)
Writes a data buffer to this instance.
Declaration
public void Write(DataBuffer buffer, int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | buffer | The buffer. |
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the buffer length. |
Write1(Boolean, Int32, Int32)
Writes a 1-bit value.
Declaration
public bool Write1(bool value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write10(Int32, Int32, Int32)
Writes a 10-bit value.
Declaration
public bool Write10(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write11(Int32, Int32, Int32)
Writes an 11-bit value.
Declaration
public bool Write11(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write12(Int32, Int32, Int32)
Writes a 12-bit value.
Declaration
public bool Write12(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write13(Int32, Int32, Int32)
Writes a 13-bit value.
Declaration
public bool Write13(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write14(Int32, Int32, Int32)
Writes a 14-bit value.
Declaration
public bool Write14(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write15(Int32, Int32, Int32)
Writes a 15-bit value.
Declaration
public bool Write15(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write16(Int32, Int32)
Writes a 16-bit value.
Declaration
public bool Write16(int value, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write16(Int32, Int32, out Int32)
Writes a 16-bit value.
Declaration
public bool Write16(int value, int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Boolean |
Write16Signed(Int32, Int32)
Writes a signed 16-bit value.
Declaration
public bool Write16Signed(int value, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write17(Int32, Int32, Int32)
Writes a 17-bit value.
Declaration
public bool Write17(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write18(Int32, Int32, Int32)
Writes an 18-bit value.
Declaration
public bool Write18(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write19(Int32, Int32, Int32)
Writes a 19-bit value.
Declaration
public bool Write19(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write2(Int32, Int32, Int32)
Writes a 2-bit value.
Declaration
public bool Write2(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write20(Int32, Int32, Int32)
Writes a 20-bit value.
Declaration
public bool Write20(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write21(Int32, Int32, Int32)
Writes a 21-bit value.
Declaration
public bool Write21(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write22(Int32, Int32, Int32)
Writes a 22-bit value.
Declaration
public bool Write22(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write23(Int32, Int32, Int32)
Writes a 23-bit value.
Declaration
public bool Write23(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write24(Int32, Int32)
Writes a 24-bit value.
Declaration
public bool Write24(int value, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write24(Int32, Int32, out Int32)
Writes a 24-bit value.
Declaration
public bool Write24(int value, int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Boolean |
Write3(Int32, Int32, Int32)
Writes a 3-bit value.
Declaration
public bool Write3(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write32(Int64, Int32)
Writes a 32-bit value.
Declaration
public bool Write32(long value, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value. |
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write32(Int64, Int32, out Int32)
Writes a 32-bit value.
Declaration
public bool Write32(long value, int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Boolean |
Write4(Int32, Int32, Int32)
Writes a 4-bit value.
Declaration
public bool Write4(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write40(Int64, Int32)
Writes a 40-bit value.
Declaration
public bool Write40(long value, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value. |
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write40(Int64, Int32, out Int32)
Writes a 40-bit value.
Declaration
public bool Write40(long value, int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Boolean |
Write48(Int64, Int32)
Writes a 48-bit value.
Declaration
public bool Write48(long value, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value. |
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write48(Int64, Int32, out Int32)
Writes a 48-bit value.
Declaration
public bool Write48(long value, int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Boolean |
Write5(Int32, Int32, Int32)
Writes a 5-bit value.
Declaration
public bool Write5(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write56(Int64, Int32)
Writes a 56-bit value.
Declaration
public bool Write56(long value, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value. |
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write56(Int64, Int32, out Int32)
Writes a 56-bit value.
Declaration
public bool Write56(long value, int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Boolean |
Write6(Int32, Int32, Int32)
Writes a 6-bit value.
Declaration
public bool Write6(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write64(Int64, Int32)
Writes a 64-bit value.
Declaration
public bool Write64(long value, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value. |
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write64(Int64, Int32, out Int32)
Writes a 64-bit value.
Declaration
public bool Write64(long value, int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Boolean |
Write7(Int32, Int32, Int32)
Writes a 7-bit value.
Declaration
public bool Write7(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write8(Int32, Int32)
Writes an 8-bit value.
Declaration
public bool Write8(int value, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Boolean |
Write8(Int32, Int32, out Int32)
Writes an 8-bit value.
Declaration
public bool Write8(int value, int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |
Returns
Type | Description |
---|---|
System.Boolean |
Write9(Int32, Int32, Int32)
Writes a 9-bit value.
Declaration
public bool Write9(int value, int offset, int bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
System.Int32 | bitOffset | The bit offset. |
Returns
Type | Description |
---|---|
System.Boolean |
WriteBytes(Byte[])
Writes a byte array to this instance.
Declaration
public void WriteBytes(byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytes | The bytes. |
WriteBytes(Byte[], Int32)
Writes a byte array to this instance.
Declaration
public void WriteBytes(byte[] bytes, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytes | The bytes. |
System.Int32 | offset | The offset. |
WriteBytes(Byte[], Int32, Int32)
Writes a byte array to this instance.
Declaration
public void WriteBytes(byte[] bytes, int bytesIndex, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytes | The bytes. |
System.Int32 | bytesIndex | The bytes index. |
System.Int32 | offset | The offset. |
WriteBytes(Byte[], Int32, Int32, Int32)
Writes a byte array to this instance.
Declaration
public void WriteBytes(byte[] bytes, int bytesIndex, int bytesLength, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytes | The bytes. |
System.Int32 | bytesIndex | The bytes index. |
System.Int32 | bytesLength | The bytes length. |
System.Int32 | offset | The offset. |
WriteBytes(Byte[], Int32, Int32, Int32, out Int32)
Writes a byte array to this instance.
Declaration
public void WriteBytes(byte[] bytes, int bytesIndex, int bytesLength, int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytes | The bytes. |
System.Int32 | bytesIndex | The bytes index. |
System.Int32 | bytesLength | The bytes length. |
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the buffer length. |
Xor(Int32, Int32)
Performs a bitwise "xor" operation on a value.
Declaration
public bool Xor(int value, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
System.Boolean |