Bytes With Addressable Bits - Tigra-Astronomy/TA.Utilities GitHub Wiki

Octet

An Octet is an immutable type that represents 8 bits, or a byte. In most cases, it can be directly used in place of a byte as there are implicit conversions to and from a byte. There are also explicit conversions to and from int and uint. The latter are explicit because there is potentially data loss, so use with care.

In an Octet, each bit position is directly addressable. You can access octet[0] through octet[7].

You can set a bit with octet.WithBitSetTo(n, state). Remember Octet is immutable so this gives you a new Octet and leaves the original unchanged.

You can perform logical bitwise operations using the & anf | operators.