Beispiel #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();
            }
        }
        public void CompositeHeapBufferWithCapacity()
        {
            IByteBufferAllocator allocator = this.NewAllocator();
            CompositeByteBuffer  buffer    = allocator.CompositeHeapBuffer(8);

            try
            {
                this.AssertCompositeByteBuffer(buffer, 8);
            }
            finally
            {
                buffer.Release();
            }
        }
Beispiel #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();
            }
        }
Beispiel #4
0
 public CompositeByteBuffer CompositeBuffer() => _allocator.CompositeHeapBuffer();