@Override
	protected long onFill() 
	{
		long memory = 0;
		// While available memory decreases...
		while (getAvailable() >= maxSize) 
		{
			ByteBuffer buffer = ByteBuffer.allocateDirect(maxSize);
			// Ensure the buffer has actually been allocated.
			if (buffer != null) {
				stack.push(buffer);
				memory += maxSize;
			}
			// Buffer allocation issue?
			else {
				return memory;
			}
		}
		return memory;
	}