Converts the array Boolean into bits of the byte array.

Namespace:  SGP.XUtility
Assembly:  SGP.XUtility (in SGP.XUtility.dll)
Version: 1.2.3019.18718

Syntax

C#
[EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
public static void ToByteArray(
	bool[] value,
	byte[] buffer,
	int offset
)

Parameters

value
Type: array< System..::.Boolean >[]()[]
The array of Boolean.
buffer
Type: array< System..::.Byte >[]()[]
An array of bytes.
offset
Type: System..::.Int32
A offset.

Remarks

Method writes the array Boolean into the array of bytes, that each item Boolean corresponds to 1 bit in the bit array. Bits are sorted from the most-significant bit to the less-significant bit.

Exceptions

ExceptionCondition
System..::.ArgumentNullException buffer is nullNothingnullptra null reference (Nothing in Visual Basic).

See Also