Java ByteBuffer Clear free(ByteBuffer buffer)

Here you can find the source of free(ByteBuffer buffer)

Description

free

License

Apache License

Declaration

public static void free(ByteBuffer buffer) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import sun.misc.Cleaner;
import sun.nio.ch.DirectBuffer;
import java.nio.ByteBuffer;

public class Main {
    public static void free(ByteBuffer buffer) {
        if (buffer.isDirect()) {
            Cleaner cleaner = ((DirectBuffer) buffer).cleaner();
            if (cleaner != null) {
                cleaner.clean();/* www  .  j  a  v a  2s  .  c om*/
            }
        }
    }
}

Related

  1. clearAndEnsureCapacity(ByteBuffer buffer, int elements)
  2. clearRemaining(ByteBuffer buffer)
  3. clearRemainingFrame(ByteBuffer buffer, int position)
  4. clearString(ByteBuffer buffer)
  5. fillBuffer(ReadableByteChannel channel, ByteBuffer buf, boolean clear)
  6. free(ByteBuffer buffer)
  7. free(ByteBuffer byteBuffer)
  8. freeDB(ByteBuffer buffer)
  9. freeMemory(ByteBuffer buffer)