long bufferSize = bufferContainer.getSize(); // size in bytes (!= length)
poolSize -= bufferContainer.getSize(); return buffer;
/** * Returns the size in bytes of the given buffer, as defined by {@link com.mucommander.commons.io.BufferPool.BufferContainer#getSize()}. * * @param buffer the buffer for which to return the size * @param factory the factory that was used to create the buffer * @return the size in bytes of the given buffer */ private int getBufferSize(Object buffer, BufferPool.BufferFactory factory) { return factory.newBufferContainer(buffer).getSize(); }