I have designed a custom file format / network message to reduce size as much as possible, but I don't know how to implement it. Any heads up will be helpful.
The first 2 bytes, correspond to 2 numbers, ranging from 0 to 63, so I'm using 6 bits. In the remaining 4 bits, I store another number, from 0 to 15.
So for example, if I have numbers 34, 25 and 15, the bits would look like:
34---|25----|15-- 10001001 10011111
I looked over BitArray, and BitConverter, but I found functions to work on 8-bit, 16-bit and 32-bit types, not on custom ones.
Of course the complete format is much longer, but if I understand this I think I'll be able to continue.
Anyone have some advice or can give me a hint to start this?
Thanks!