예제 #1
0
        void TestCompositeHeapBufferWithCapacity(bool preferDirect, int maxNumComponents)
        {
            IByteBufferAllocator allocator = this.NewAllocator(preferDirect);
            CompositeByteBuffer  buffer    = allocator.CompositeHeapBuffer(maxNumComponents);

            try
            {
                this.AssertCompositeByteBuffer(buffer, maxNumComponents);
            }
            finally
            {
                buffer.Release();
            }
        }
예제 #2
0
        public void CompositeHeapBufferWithCapacity()
        {
            IByteBufferAllocator allocator = this.NewAllocator();
            CompositeByteBuffer  buffer    = allocator.CompositeHeapBuffer(8);

            try
            {
                this.AssertCompositeByteBuffer(buffer, 8);
            }
            finally
            {
                buffer.Release();
            }
        }
예제 #3
0
        public void CompositeHeapBuffer(bool preferDirect)
        {
            IByteBufferAllocator allocator = this.NewAllocator(preferDirect);
            CompositeByteBuffer  buffer    = allocator.CompositeHeapBuffer();

            try
            {
                this.AssertCompositeByteBuffer(buffer, this.DefaultMaxComponents);
            }
            finally
            {
                buffer.Release();
            }
        }
예제 #4
0
 public CompositeByteBuffer CompositeBuffer() => _allocator.CompositeHeapBuffer();