Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement BitReader and BitWriter #78

Open
pleonex opened this issue Dec 8, 2018 · 1 comment
Open

Implement BitReader and BitWriter #78

pleonex opened this issue Dec 8, 2018 · 1 comment

Comments

@pleonex
Copy link
Member

pleonex commented Dec 8, 2018

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
Copy link
Member Author

pleonex commented Dec 11, 2018

As a reference I did a PoC for PlayMobic and here and this other in Python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

1 participant