private void dropUpstreamFrom(long absolutePosition){
  int relativePosition=(int)(absolutePosition - totalBytesDropped);
  int allocationIndex=relativePosition / allocationLength;
  int allocationOffset=relativePosition % allocationLength;
  int allocationDiscardCount=dataQueue.size() - allocationIndex - 1;
  if (allocationOffset == 0) {
    allocationDiscardCount++;
  }
  for (int i=0; i < allocationDiscardCount; i++) {
    allocator.release(dataQueue.removeLast());
  }
  lastAllocation=dataQueue.peekLast();
  lastAllocationOffset=allocationOffset == 0 ? allocationLength : allocationOffset;
}

private void dropUpstreamFrom ( long absolutePosition ) { int relativePosition = ( int ) ( absolutePosition - totalBytesDropped ) ; int allocationIndex = relativePosition / allocationLength ; int allocationOffset = relativePosition % allocationLength ; int allocationDiscardCount = dataQueue . size ( ) - allocationIndex - 1 ; if ( allocationOffset == 0 ) { allocationDiscardCount ++ ; } for ( int i = 0 ; i < allocationDiscardCount ; i ++ ) { allocator . release ( dataQueue . removeLast ( ) ) ; } lastAllocation = dataQueue . peekLast ( ) ; lastAllocationOffset = allocationOffset == 0 ? allocationLength : allocationOffset ; }
discards data from the write side of the buffer . data is discarded from the specified absolute position . any allocations that are fully discarded are returned to the allocator .
