| Modifier and Type | Field and Description |
|---|---|
| private final Deque | |
| private final int | |
| private static BufferAllocatorFactory | |
| private static final Map | queueTable
Use SoftReference so that having this queueTable does not prevent the GC of CachedBufferAllocator instances |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public byte[] | |
| public static synchronized CachedBufferAllocator | |
| public static BufferAllocatorFactory | |
| public void | |
| public static void |
| bufferQueue | back to summary |
|---|---|
| private final Deque<byte[]> bufferQueue | |
| bufferSize | back to summary |
|---|---|
| private final int bufferSize | |
| factory | back to summary |
|---|---|
| private static BufferAllocatorFactory factory | |
| queueTable | back to summary |
|---|---|
| private static final Map<Integer, SoftReference<CachedBufferAllocator>> queueTable Use SoftReference so that having this queueTable does not prevent the GC of CachedBufferAllocator instances | |
| CachedBufferAllocator | back to summary |
|---|---|
| public CachedBufferAllocator(int bufferSize) | |
| allocate | back to summary |
|---|---|
| public byte[] allocate(int size) Implements org.
| |
| getAllocator | back to summary |
|---|---|
| public static synchronized CachedBufferAllocator getAllocator(int bufferSize) | |
| getBufferAllocatorFactory | back to summary |
|---|---|
| public static BufferAllocatorFactory getBufferAllocatorFactory() | |
| release | back to summary |
|---|---|
| public void release(byte[] buffer) Implements org.
| |
| setBufferAllocatorFactory | back to summary |
|---|---|
| public static void setBufferAllocatorFactory(BufferAllocatorFactory factory) | |