Package io.github.classgraph
Class CloseableByteBuffer
java.lang.Object
io.github.classgraph.CloseableByteBuffer
- All Implemented Interfaces:
Closeable,AutoCloseable
A wrapper for
ByteBuffer that implements the Closeable interface, releasing the
ByteBuffer when it is no longer needed.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCloseableByteBuffer(ByteBuffer byteBuffer, Runnable onClose) A wrapper forByteBufferthat implements theCloseableinterface, releasing theByteBufferwhen it is no longer needed. -
Method Summary
-
Field Details
-
byteBuffer
-
onClose
-
-
Constructor Details
-
CloseableByteBuffer
CloseableByteBuffer(ByteBuffer byteBuffer, Runnable onClose) A wrapper forByteBufferthat implements theCloseableinterface, releasing theByteBufferwhen it is no longer needed.- Parameters:
byteBuffer- TheByteBufferto wraponClose- The method to run whenclose()is called.
-
-
Method Details
-
getByteBuffer
- Returns:
- The wrapped
ByteBuffer.
-
close
Release the wrappedByteBuffer.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-