예제 #1
0
        public void TestPeekInt()
        {
            buffer.WriteInt(1);
            buffer.WriteInt(2);

            buffer.Reset();
            Assert.AreEqual(1, buffer.PeekInt());
            Assert.AreEqual(2, buffer.PeekInt(1 * sizeof(int)));

            buffer.Wipe();

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

            buffer.Wipe();
        }