/** * Depending on the type of buffer different cleanup action will be taken: * * <ul> * <li>if the buffer is memory mapped (as per the specified parameter) the effect is the same * as {@link #clean(ByteBuffer)} * <li>if the buffer is not memory mapped it will be returned to the buffer cache * </ul> * * @param buffer * @return */ public static boolean clean(final ByteBuffer buffer, boolean memoryMapped) { if (memoryMapped) { return clean(buffer); } else { if (returnToCache(buffer)) { return true; } else { return clean(buffer); } } }