/** * Clears the buffer, returning all allocations to the allocator. */ public void clear() { infoQueue.clear(); while (!dataQueue.isEmpty()) { allocator.release(dataQueue.remove()); } totalBytesDropped = 0; totalBytesWritten = 0; lastAllocation = null; lastAllocationOffset = allocationLength; }