public void TestReadAfterMove()
        {
            var bytes  = new byte[] { 117, 243, 11, 3, 57 };
            var reader = new BinaryCodeReader(bytes);

            reader.MoveBytePointer(1);
            Assert.AreEqual(bytes[1], reader.ReadNextByte());
            reader.MoveBytePointer(-1);
            reader.MoveBitPointer(3);
            Assert.AreEqual(126, reader.ReadNextByte());
            reader.MoveBitPointer(5);
            Assert.AreEqual(3, reader.ReadNextByte());
            reader.MoveBytePointer(-4);
            Assert.AreEqual(117, reader.ReadNextByte());
        }
        public void TestReadBytes()
        {
            var bytes  = new byte[] { 113, 25, 45, 79, 13, 51 };
            var reader = new BinaryCodeReader(bytes);

            for (int i = 0; i < bytes.Length; i++)
            {
                Assert.AreEqual(bytes[i], reader.ReadNextByte());
            }
        }
        protected uint DecodeLength(BinaryCodeReader reader)
        {
            int lengthSizeInBytes = (reader.ReadNextBit() + 1) + reader.ReadNextBit() * 2;
            var lengthBytes       = new byte[4] {
                0, 0, 0, 0
            };

            for (int i = 0; i < lengthSizeInBytes; i++)
            {
                lengthBytes[i] = reader.ReadNextByte();
            }
            return(BitConverter.ToUInt32(lengthBytes, 0));
        }