Summary
Encapsulates a binary value 128 bits long. See Remarks.
Remarks
This type is significantly more memory-efficient compared to
byte[16]
when only one copy of the value needs
to be stored. Specifically, the byte array uses four extra IntPtrs per instance, which, on a 64-bit platform,
amounts to a three-fold RAM usage increase. It can also be compared for equality using just two integer
comparisons in safe code.
Constructors
Bin128(byte[] bytes, int offset = 0) |
Constructor. Initializes this value to contain the same data as the specified byte array. |
Instance methods
bool | | Compares an object to this value and returns true iff it's a Bin128 value that's equal. |
int | | Gets the hash code for this value. |
byte[] | | Returns the binary value as a byte array. This method is not very efficient. |
string | | Converts the binary value to a hexadecimal string representation. |
void | | Writes the value to the specified stream as 16 bytes. |
void | | Writes the value to the specified binary writer as 16 bytes. |
Static methods
Bin128 | | Reads a 128-bit binary value from the specified stream. |
Bin128 | | Reads a 128-bit binary value from the specified binary reader. |
Operators
bool | | Compares the two values and returns true iff they are equal. |
bool | | Compares the two values and returns true iff they are different. |
Static fields
Bin128 | | Gets a 128-bit binary value consisting of all zeroes. |