Beispiel #1
0
        public void TestWriteBackingBytes()
        {
            var backingBytes = new byte[100];

            using (var buffer = new ByteArrayBuffer(backingBytes, 0, 0, false))
            {
                var segment = buffer.WriteBackingBytes(10);
                Assert.AreSame(backingBytes, segment.Array);
                Assert.AreEqual(0, segment.Offset);
                Assert.AreEqual(10, segment.Count);
                buffer.Position += 1;
                Assert.AreEqual(1, buffer.Position);
                Assert.AreEqual(1, buffer.Length);
            }
        }