@Override
	protected boolean onCache(ByteBuffer buffer) 
	{
		int capacity = buffer.capacity();
		
		// We're only pooling direct buffers whose capacity is a power of 2.
		if (!buffer.isDirect() || !isPowerOf2(capacity)) {
			return false;
		}
		
		// Compute the power of the buffer using log2
		int power = log2(capacity);
	
		// If the power is to small or to large then don't pool it.
		if (power < minPower || power > maxPower) {
			return false;
		}
		
		// Calculate the index of the pool using minPower.
		int index = power - minPower;
		
		// Place the buffer on the stack
		pool[index].push(buffer);
		
		return true;
	}