private void OnCurrentBitReset(byte valueFromBuffer)
        {
            if (ReachedEndOfFile)
            {
                return;
            }

            if (fileStream.Position == fileStream.Length)
            {
                ReachedEndOfFile = true;
                buffer.AddValueStartingFromCurrentBit(127, 7);
                return;
            }

            buffer.Value = (byte)fileStream.ReadByte();
        }
Пример #2
0
        public void WriteBit(bool bitValue)
        {
            var valueToWrite = bitValue ? (byte)1 : (byte)0;

            buffer.AddValueStartingFromCurrentBit(valueToWrite, 1);
        }