Ejemplo n.º 1
0
        public void ReadBytesSuccessfully()
        {
            var result = new List <ushort>(mResult.Length);
            var reader = new BitsReader(mInput);

            for (int i = 1; i < 17; i++)
            {
                result.Add(reader.ReadUInt16(i));
                result.Add(reader.ReadUInt16(i));
            }

            Assert.AreEqual(mResult, result.ToArray());
        }
Ejemplo n.º 2
0
        public void ReadShouldThrow(byte[] input)
        {
            var reader = new BitsReader(input);

            for (int i = 0; i < 2; ++i)
            {
                reader.ReadUInt16(16);
            }
        }
Ejemplo n.º 3
0
 private static void ReadMeExample1()
 {
     byte[] bytes  = { 25, 26, 27, 28, 29, 30, 31 };
     var    reader = new BitsReader(bytes);
     byte   A      = reader.ReadUInt8(4);
     short  B      = reader.ReadInt16(12);
     int    C      = reader.ReadInt32(24);
     ushort D      = reader.ReadUInt16(13);
     sbyte  E      = reader.ReadInt8(3);
 }