public class CachedBufferAllocator extends java.lang.Object implements BufferAllocator
| Modifier and Type | Field and Description |
|---|---|
static BufferAllocatorFactory |
factory |
static java.util.Map<java.lang.Integer,java.lang.ref.SoftReference<CachedBufferAllocator>> |
queueTable
Use SoftReference so that having this queueTable does not prevent the GC of CachedBufferAllocator instances
|
| Constructor and Description |
|---|
CachedBufferAllocator(int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
allocate(int size) |
static CachedBufferAllocator |
getAllocator(int bufferSize) |
void |
release(byte[] buffer) |
public static BufferAllocatorFactory factory
public static java.util.Map<java.lang.Integer,java.lang.ref.SoftReference<CachedBufferAllocator>> queueTable
public static CachedBufferAllocator getAllocator(int bufferSize)
public byte[] allocate(int size)
allocate in interface BufferAllocatorpublic void release(byte[] buffer)
release in interface BufferAllocator