private int extract(final int index,final byte a[],final int offset,final int length){
  final BackingBuffer bb=this.bb;
  final int delta=index % ratio;
  final int startPos=p[index / ratio];
  int pos, prevArrayPos, currLen=0, actualCommon;
  int arrayLength=bb.readInt(pos=startPos);
  if (delta == 0) {
    pos=p[index / ratio] + count(arrayLength);
    bb.arraycopy(pos,a,offset,Math.min(length,arrayLength));
    return arrayLength;
  }
  int common=0;
  for (int i=0; i < delta; i++) {
    prevArrayPos=pos + count(arrayLength) + (i != 0 ? count(common) : 0);
    pos=prevArrayPos + arrayLength;
    arrayLength=bb.readInt(pos);
    common=bb.readInt(pos + count(arrayLength));
    actualCommon=Math.min(common,length);
    if (actualCommon <= currLen)     currLen=actualCommon;
 else {
      bb.arraycopy(prevArrayPos,a,currLen + offset,actualCommon - currLen);
      currLen=actualCommon;
    }
  }
  if (currLen < length)   bb.arraycopy(pos + count(arrayLength) + count(common),a,currLen + offset,Math.min(arrayLength,length - currLen));
  return arrayLength + common;
}

private int extract ( final int index , final byte a [ ] , final int offset , final int length ) { final BackingBuffer bb = this . bb ; final int delta = index % ratio ; final int startPos = p [ index / ratio ] ; int pos , prevArrayPos , currLen = 0 , actualCommon ; int arrayLength = bb . readInt ( pos = startPos ) ; if ( delta == 0 ) { pos = p [ index / ratio ] + count ( arrayLength ) ; bb . arraycopy ( pos , a , offset , Math . min ( length , arrayLength ) ) ; return arrayLength ; } int common = 0 ; for ( int i = 0 ; i < delta ; i ++ ) { prevArrayPos = pos + count ( arrayLength ) + ( i != 0 ? count ( common ) : 0 ) ; pos = prevArrayPos + arrayLength ; arrayLength = bb . readInt ( pos ) ; common = bb . readInt ( pos + count ( arrayLength ) ) ; actualCommon = Math . min ( common , length ) ; if ( actualCommon <= currLen ) currLen = actualCommon ; else { bb . arraycopy ( prevArrayPos , a , currLen + offset , actualCommon - currLen ) ; currLen = actualCommon ; } } if ( currLen < length ) bb . arraycopy ( pos + count ( arrayLength ) + count ( common ) , a , currLen + offset , Math . min ( arrayLength , length - currLen ) ) ; return arrayLength + common ; }
extracts the array at the given index .
