Yarhl icon indicating copy to clipboard operation
Yarhl copied to clipboard

Implement BitReader and BitWriter

Open pleonex opened this issue 5 years ago • 1 comments

Some binary formats requires to read / write fields bit by bit. We need to provide a solution for bit-level reading and writing.

I have considered implementing new methods in BinaryWriter and BinaryReader but it would make the implementation more complex since every other type like integer or string may need to mix bytes to be read. We should keep implementation different like BinaryReader and TextReader.

It should be able to read an write the following types:

  • Single bit in boolean
  • BitArray
  • Array of bytes
  • Integer of variable bit size

pleonex avatar Dec 08 '18 11:12 pleonex