public void TestWrapSubArray()
        {
            byte[] array = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

            IoBuffer buf = allocator.Wrap(array, 3, 4);

            Assert.AreEqual(3, buf.Position);
            Assert.AreEqual(7, buf.Limit);
            Assert.AreEqual(10, buf.Capacity);

            buf.Clear();
            Assert.AreEqual(0, buf.Position);
            Assert.AreEqual(10, buf.Limit);
            Assert.AreEqual(10, buf.Capacity);
        }
Example #2
0
 /// <summary>
 /// Wraps the specified byte array into MINA buffer.
 /// </summary>
 public static IoBuffer Wrap(Byte[] array)
 {
     return(allocator.Wrap(array));
 }