/** * Release a buffer and make it available for reuse. * * @param buffer buffer to release */ public static final void release(final ByteBuffer buffer) { BYTE_BUFFER_CACHE.release(buffer); }
/** * Allocate a new buffer * * @param capacity * @return the new allocated or reused buffer. May not be filled with 0. */ public static final ByteBuffer allocate(final int capacity) { return BYTE_BUFFER_CACHE.allocate(capacity); }