Last active
January 3, 2016 06:19
-
-
Save oguzhaneren/8422323 to your computer and use it in GitHub Desktop.
Bit Reader and Writer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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