Skip to content

Instantly share code, notes, and snippets.

@oguzhaneren
Last active January 3, 2016 06:19
Show Gist options
  • Save oguzhaneren/8422323 to your computer and use it in GitHub Desktop.
Save oguzhaneren/8422323 to your computer and use it in GitHub Desktop.
Bit Reader and Writer
public class BitWriter
: BinaryWriter
{
public BitWriter(Stream output) : base(output)
{
}
public void Write7BitInt(int value)
{
Write7BitEncodedInt(value);
}
protected override void Dispose(bool disposing)
{
Flush();
}
}
public class BitReader : BinaryReader
{
public BitReader(Stream input)
: base(input)
{
}
public int Read7BitInt()
{
return Read7BitEncodedInt();
}
protected override void Dispose(bool disposing)
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment