public static interface AdaptiveBufAllocator.Handle
| 限定符和类型 | 方法和说明 |
|---|---|
ByteBufferCollector |
allocate()
Creates a new buffer whose capacity is probably large enough to write all outbound data and small
enough not to waste its space.
|
ByteBufferCollector |
allocateByRecyclers()
Gets a buffer from recyclers whose capacity is probably large enough to write all outbound data and
small enough not to waste its space, recycling is needed.
|
int |
guess()
Similar to
allocate() except that it does not allocate anything but
just tells the capacity. |
void |
record(int actualWroteBytes)
Records the the actual number of wrote bytes in the previous write operation so that the allocator
allocates the buffer with potentially more correct capacity.
|
ByteBufferCollector allocate()
ByteBufferCollector allocateByRecyclers()
int guess()
allocate() except that it does not allocate anything but
just tells the capacity.void record(int actualWroteBytes)
actualWroteBytes - the actual number of wrote bytes in the previous allocate operationCopyright © 2021. All rights reserved.