I\'m working on a bit-based B/W/Greyscale Pre-Compiled font format, and was having issues with either reading or writing the format, (I\'ve not been able to determine where the
If you keep your data in a byte array (bools are of no use and take too much space, if you use them for bits, they take up a byte in memory) or in an array of a particular struct
that fits your dataformat.
Once you have an internal memory representation, you don't need a bit-based binary writer anymore. You can simply write the data to a BinaryWriter and you're done with it.
...but the default .Net 4.0 BinaryWriter writes a Boolean value as a full byte, and as you can imagine, that negates the use of a bit-based format....
The reason for this is: the bool is, by definition, of 1 byte size in C#. The BinaryWriter simply writes what you give it.