BitWriterto serialize, and
BitReaderto deserialize data down to the bit.
float3position in a message:
WriteInteither writes all 4 bytes
int, or none if there is not enough space.
ReadInteither reads all 4 bytes
int, or none if the buffer doesn’t have enough data.
ushort/etc.) as fast as aligned writes (
[1..60]so we can Bitpack it down from 32 bits to 6 bits:
doublewhere we specify min, max, precision
bool, which C# stores into 8 bit = 1 byte by default. A
boolis always either 1 or 0, which fits perfectly into just 1 bit. DOTSNET packs bools automatically!