Example #1
0
        public void TestPeekByte()
        {
            buffer.WriteByte(1);
            buffer.WriteByte(2);

            buffer.Reset();
            Assert.AreEqual(1, buffer.PeekByte());
            Assert.AreEqual(2, buffer.PeekByte(1));

            buffer.Wipe();

            buffer.WriteByteArray(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 });
            buffer.Reset();
            Assert.AreEqual(4, buffer.PeekByte(sizeof(byte) + 3));
            Assert.AreEqual(5, buffer.PeekByte(sizeof(byte) + 4));

            buffer.Wipe();
        }