private void readData(long absolutePosition,ByteBuffer target,int length){
  int remaining=length;
  while (remaining > 0) {
    dropDownstreamTo(absolutePosition);
    int positionInAllocation=(int)(absolutePosition - totalBytesDropped);
    int toCopy=Math.min(remaining,allocationLength - positionInAllocation);
    Allocation allocation=dataQueue.peek();
    target.put(allocation.data,allocation.translateOffset(positionInAllocation),toCopy);
    absolutePosition+=toCopy;
    remaining-=toCopy;
  }
}

private void readData ( long absolutePosition , ByteBuffer target , int length ) { int remaining = length ; while ( remaining > 0 ) { dropDownstreamTo ( absolutePosition ) ; int positionInAllocation = ( int ) ( absolutePosition - totalBytesDropped ) ; int toCopy = Math . min ( remaining , allocationLength - positionInAllocation ) ; Allocation allocation = dataQueue . peek ( ) ; target . put ( allocation . data , allocation . translateOffset ( positionInAllocation ) , toCopy ) ; absolutePosition += toCopy ; remaining -= toCopy ; } }
reads data from the front of the rolling buffer .
