Hi, I was looking for a way to read bits in a byte[] array and advance the position, and I came across the BitStream library (https://github.com/Sewer56/Sewer56.BitStream) because we can't do it natively in C#. The problem is that I've noticed that I'm not getting the expected behavior in my code At first, I need to read an int32 in my byte stream, so I did :
var stream = new ArrayByteStream(buffer);var bitStream = new BitStream<ArrayByteStream>(stream);var header = bitStream.Read<int>();Console.WriteLine(header);
var stream = new ArrayByteStream(buffer);var bitStream = new BitStream<ArrayByteStream>(stream);var header = bitStream.Read<int>();Console.WriteLine(header);
I don't want to write a code that will only retrieve the first two characters because I don't necessarily know the size Do you know why the BitStream library reacts like this? When I use MemoryStream + BinaryReader it works perfectly except that I get stuck when I have to read bits in a stream...