private final class ByteBufferPool.ByteBufferAllocatorImpl extends java.lang.Object implements ByteBufferAllocator
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.Semaphore |
semaphore
The semaphore used to limit the number of buffers
allocated through this allocator.
|
Modifier | Constructor and Description |
---|---|
private |
ByteBufferAllocatorImpl(int maxBufferCount)
Creates a new allocator.
|
Modifier and Type | Method and Description |
---|---|
java.nio.ByteBuffer |
allocate()
Allocates a byte buffer.
|
void |
release(java.nio.ByteBuffer byteBuffer)
Releases a byte buffer.
|
private final java.util.concurrent.Semaphore semaphore
private ByteBufferAllocatorImpl(int maxBufferCount)
public java.nio.ByteBuffer allocate() throws java.lang.InterruptedException
allocate
in interface ByteBufferAllocator
java.lang.InterruptedException
public void release(java.nio.ByteBuffer byteBuffer)
release
in interface ByteBufferAllocator