private void readData(long absolutePosition,byte[] target,int length){
  int bytesRead=0;
  while (bytesRead < length) {
    dropDownstreamTo(absolutePosition);
    int positionInAllocation=(int)(absolutePosition - totalBytesDropped);
    int toCopy=Math.min(length - bytesRead,allocationLength - positionInAllocation);
    Allocation allocation=dataQueue.peek();
    System.arraycopy(allocation.data,allocation.translateOffset(positionInAllocation),target,bytesRead,toCopy);
    absolutePosition+=toCopy;
    bytesRead+=toCopy;
  }
}

private void readData ( long absolutePosition , byte [ ] target , int length ) { int bytesRead = 0 ; while ( bytesRead < length ) { dropDownstreamTo ( absolutePosition ) ; int positionInAllocation = ( int ) ( absolutePosition - totalBytesDropped ) ; int toCopy = Math . min ( length - bytesRead , allocationLength - positionInAllocation ) ; Allocation allocation = dataQueue . peek ( ) ; System . arraycopy ( allocation . data , allocation . translateOffset ( positionInAllocation ) , target , bytesRead , toCopy ) ; absolutePosition += toCopy ; bytesRead += toCopy ; } }
reads data from the front of the rolling buffer .
