Top Description Fields Constructors Methods
io.github.classgraph

public Class CloseableByteBuffer

extends Object
implements Closeable
Class Inheritance
All Implemented Interfaces
java.io.Closeable, java.lang.AutoCloseable
Imports
java.io.Closeable, .IOException, java.nio.ByteBuffer

A wrapper for ByteBuffer that implements the Closeable interface, releasing the ByteBuffer when it is no longer needed.

Field Summary

Modifier and TypeField and Description
private ByteBuffer
private Runnable

Constructor Summary

AccessConstructor and Description
pack-priv
CloseableByteBuffer(final ByteBuffer
The ByteBuffer to wrap
byteBuffer
,
final Runnable
The method to run when close() is called.
onClose
)

A wrapper for ByteBuffer that implements the Closeable interface, releasing the ByteBuffer when it is no longer needed.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Release the wrapped ByteBuffer.

public ByteBuffer

Returns:

The wrapped ByteBuffer.
getByteBuffer
()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

byteBufferback to summary
private ByteBuffer byteBuffer
onCloseback to summary
private Runnable onClose

Constructor Detail

CloseableByteBufferback to summary
pack-priv CloseableByteBuffer(final ByteBuffer byteBuffer, final Runnable onClose)

A wrapper for ByteBuffer that implements the Closeable interface, releasing the ByteBuffer when it is no longer needed.

Parameters
byteBuffer:ByteBuffer

The ByteBuffer to wrap

onClose:Runnable

The method to run when close() is called.

Method Detail

closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Release the wrapped ByteBuffer.

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Closeable.close.

if an I/O error occurs

getByteBufferback to summary
public ByteBuffer getByteBuffer()
Returns:ByteBuffer

The wrapped ByteBuffer.