Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }