Skip to content

ByteExtensions.CopyBitsFrom Method ​

Definition ​

Copies bits from one byte to another using a mask.

c#
public static Byte CopyBitsFrom(this Byte input, Byte toCopyFrom, Byte mask);

View source

Parameters ​

NameTypeDescription
inputByteThe byte to copy bits into.
toCopyFromByteThe byte to copy bits from.
maskByteA mask specifying which bits to copy. Set bits in the mask indicate positions to copy from toCopyFrom.

Returns ​

Byte

A new byte with masked bits from toCopyFrom and unmasked bits from input.