class DirectByteBuffer implements ByteBuffer {

  public void free() {
    try {
      java.lang.reflect.Field cleanerField = byteBuffer.getClass().getDeclaredField("cleaner");
      cleanerField.setAccessible(true);
      // Cleaner can force freeing of native memory by clean method
      sun.misc.Cleaner cleaner = (sun.misc.Cleaner) cleanerField.get(byteBuffer);
      cleaner.clean();
    } catch (Exception e) {
      throw new Error(e);
    }
  }

  public  DirectByteBuffer(final int capacity);

}