if(bufferContainer.getLength()==size && (factory.matchesBufferClass(buffer.getClass()))) { bufferContainers.removeElementAt(i); poolSize -= bufferContainer.getSize();
/** * Returns the length of the given buffer, as defined by {@link com.mucommander.commons.io.BufferPool.BufferContainer#getLength()}. * * @param buffer the buffer for which to return the length * @param factory the factory that was used to create the buffer * @return the length of the given buffer */ private int getBufferLength(Object buffer, BufferPool.BufferFactory factory) { return factory.newBufferContainer(buffer).getLength(); }