List of utility methods to do ByteBuffer Clear
void | free(ByteBuffer buffer) free if (buffer.isDirect()) { Cleaner cleaner = ((DirectBuffer) buffer).cleaner(); if (cleaner != null) { cleaner.clean(); |
void | free(ByteBuffer buffer) Releases memory held by the given direct ByteBuffer if (buffer.isDirect()) {
clean((DirectBuffer) buffer);
|
boolean | free(ByteBuffer byteBuffer) Try deallocate direct byte buffer, do nothing if buffer is not direct if (byteBuffer == null || !byteBuffer.isDirect()) { return false; try { Method getCleanerMethod = byteBuffer.getClass().getDeclaredMethod("cleaner"); getCleanerMethod.setAccessible(true); Object cleaner = getCleanerMethod.invoke(byteBuffer); if (cleaner != null) { ... |
void | freeDB(ByteBuffer buffer) Forcibly free the direct buffer. if (buffer instanceof sun.nio.ch.DirectBuffer) { final sun.misc.Cleaner bufferCleaner = ((sun.nio.ch.DirectBuffer) buffer).cleaner(); bufferCleaner.clean(); |
void | freeMemory(ByteBuffer buffer) free Memory |