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 forByteBuffer
that implements theCloseable
interface, releasing theByteBuffer
when it is no longer needed. -
Method Summary
-
Field Details
-
byteBuffer
-
onClose
-
-
Constructor Details
-
CloseableByteBuffer
CloseableByteBuffer(ByteBuffer byteBuffer, Runnable onClose) A wrapper forByteBuffer
that implements theCloseable
interface, releasing theByteBuffer
when it is no longer needed.- Parameters:
byteBuffer
- TheByteBuffer
to wraponClose
- The method to run whenclose()
is called.
-
-
Method Details
-
getByteBuffer
- Returns:
- The wrapped
ByteBuffer
.
-
close
Release the wrappedByteBuffer
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-