public void clean()

in src/main/java/com/spotify/sparkey/ByteBufferCleaner.java [41:53]


    public void clean(final MappedByteBuffer byteBuffer) {
      try {
        final Class<? extends MappedByteBuffer> clazz = byteBuffer.getClass();
        final Method getCleanerMethod = clazz.getMethod("cleaner");
        getCleanerMethod.setAccessible(true);
        final Object cleaner = getCleanerMethod.invoke(byteBuffer);
        if (cleaner != null) {
          cleaner.getClass().getMethod("clean").invoke(cleaner);
        }
      } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
        throw new RuntimeException(e);
      }
    }