public class BytesPool extends Object implements AutoCloseable
Bytes pool.| Modifier and Type | Class and Description |
|---|---|
class |
BytesPool.PooledBytes
Specific
Bytes implementation for the pools. |
| Constructor and Description |
|---|
BytesPool() |
| Modifier and Type | Method and Description |
|---|---|
BytesPool.PooledBytes |
acquire()
Return the pooled bytes buffer.
|
BytesPool.PooledBytes |
acquire(int minSize)
Return the pooled bytes buffer with guaranteed minimal size.
|
void |
close() |
int |
getAcquiredCount()
Returns the acquired buffers count.
|
int |
getFreeCount()
Returns the free buffers count.
|
int |
getTotalCount()
Returns the total buffers count.
|
void |
release(@NonNull BytesPool.PooledBytes buffer)
Release the acquired bytes buffer.
|
public BytesPool.PooledBytes acquire()
Bytes instancepublic BytesPool.PooledBytes acquire(int minSize)
minSize - expected minimal buffer size in mytesBytes instancepublic void release(@NonNull
@NonNull BytesPool.PooledBytes buffer)
buffer - the buffer to releasepublic int getAcquiredCount()
public int getFreeCount()
public int getTotalCount()
public void close()
close in interface AutoCloseableCopyright © 2019–2020 Appulse. All rights reserved.