public byte ReadByte(int numberOfBits) { int newPosition = bitPosition + numberOfBits; if (overflow || newPosition > endBitPosition) { overflow = true; return(0); } byte value = BitWriter.ReadByte(data, numberOfBits, bitPosition); bitPosition = newPosition; return(value); }
public bool ReadBoolean() { int newPosition = bitPosition + 1; if (overflow || newPosition > endBitPosition) { overflow = true; return(false); } byte value = BitWriter.ReadByte(data, 1, bitPosition); bitPosition = newPosition; return(value > 0 ? true : false); }
public byte ReadByte() { int newPosition = bitPosition + 8; if (overflow || newPosition > endBitPosition) { overflow = true; return(0); } byte value = BitWriter.ReadByte(data, 8, bitPosition); bitPosition = newPosition; return(value); }