public class ByteBufferReleaser extends Object implements AutoCloseable
ByteBuffer objects with the corresponding allocator;| Constructor and Description |
|---|
ByteBufferReleaser(ByteBufferAllocator allocator)
Constructs a new
ByteBufferReleaser instance with the specified ByteBufferAllocator to be used for
releasing the buffers in close(). |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
releaseLater(ByteBuffer buffer)
Adds a
ByteBuffer object to the list of buffers to be released at close(). |
public ByteBufferReleaser(ByteBufferAllocator allocator)
ByteBufferReleaser instance with the specified ByteBufferAllocator to be used for
releasing the buffers in close().allocator - the allocator to be used for releasing the buffersreleaseLater(ByteBuffer),
close()public void releaseLater(ByteBuffer buffer)
ByteBuffer object to the list of buffers to be released at close(). The specified buffer
shall be one that was allocated by the ByteBufferAllocator of this object.buffer - the buffer to be releasedpublic void close()
close in interface AutoCloseableCopyright © 2023 The Apache Software Foundation. All rights reserved.