JavaScript is disabled on your browser.
XNIO API 3.0.17.GA-redhat-13.0.17.GA-redhat-1
java.lang.Object
org.xnio.ByteBufferSlicePool
All Implemented Interfaces:
Pool <java.nio.ByteBuffer>
public final class ByteBufferSlicePool
extends java.lang.Object
implements Pool <java.nio.ByteBuffer>
A buffer pooled allocator. This pool uses a series of buffer regions to back the
returned pooled buffers. When the buffer is no longer needed, it should be freed back into the pool; failure
to do so will cause the corresponding buffer area to be unavailable until the buffer is garbage-collected.
Author:
David M. Lloyd
Constructor Summary
Constructors
Constructor and Description
ByteBufferSlicePool (BufferAllocator <java.nio.ByteBuffer> allocator,
int bufferSize,
int maxRegionSize)
Construct a new instance.
ByteBufferSlicePool (int bufferSize,
int maxRegionSize)
Construct a new instance, using a direct buffer allocator.
Method Summary
Methods
Modifier and Type
Method and Description
Pooled <java.nio.ByteBuffer>
allocate ()
Allocate a resource from the pool.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail
ByteBufferSlicePool
public ByteBufferSlicePool(BufferAllocator <java.nio.ByteBuffer> allocator,
int bufferSize,
int maxRegionSize)
Construct a new instance.
Parameters: allocator
- the buffer allocator to usebufferSize
- the size of each buffermaxRegionSize
- the maximum region size for each backing buffer
ByteBufferSlicePool
public ByteBufferSlicePool(int bufferSize,
int maxRegionSize)
Construct a new instance, using a direct buffer allocator.
Parameters: bufferSize
- the size of each buffermaxRegionSize
- the maximum region size for each backing buffer
XNIO API 3.0.17.GA-redhat-13.0.17.GA-redhat-1
Copyright © 2010 JBoss, a division of Red Hat, Inc.