I dunno man

This commit is contained in:
Lani Aung
2024-10-06 23:12:50 -06:00
parent 9c44ec0156
commit e3f23389da
6 changed files with 97 additions and 46 deletions
+15 -5
View File
@@ -41,17 +41,27 @@ public class BitStream : Stream
}
var buffer = _bitBuffer;
buffer >>= 32 - bitLength;
#if DEBUG
Console.WriteLine($"BitStream buffer: {_bitBuffer:b}, extracted number: {buffer:b}");
#endif
_bitBuffer <<= bitLength;
if (bitLength < 32)
{
buffer >>= 32 - bitLength;
_bitBuffer <<= bitLength;
}
else
{
_bitBuffer = 0;
}
Position += bitLength;
_bitBufferCount -= bitLength;
return buffer;
}
public override int ReadByte()
{
return (int)ReadBits(8);
}
public override void Flush()
{
throw new NotImplementedException();