public class ThreadLocalReusableByteBuffer extends ThreadLocalHolder<ReusableByteBuffer>
ReusableByteBuffer
.
Note: This class is for internal use only and subject to backward incompatible change at any time.
ThreadLocalHolder.HolderRef, ThreadLocalHolder.Lifecycle
threadValues
Constructor and Description |
---|
ThreadLocalReusableByteBuffer()
Create a new instance with an initial capacity set to
|
ThreadLocalReusableByteBuffer(int initialCapacity)
Create a new instance with an initial capacity of
initialSize bytes. |
Modifier and Type | Method and Description |
---|---|
protected boolean |
recycleInstance(ReusableByteBuffer buffer)
Return a buffer to the pool after usage.
|
acquire, close, createInstance, disposeInstance, release
public ThreadLocalReusableByteBuffer(int initialCapacity)
initialSize
bytes.initialCapacity
- the initial capacity of bufferspublic ThreadLocalReusableByteBuffer()
protected boolean recycleInstance(ReusableByteBuffer buffer)
recycleInstance
in class ThreadLocalHolder<ReusableByteBuffer>
buffer
- the buffer to return to the pool.true
if the instance can be recycled and returned to the pool, false
if not.Copyright © 2013–2022. All rights reserved.