public void copyResiduals(byte[] source,int targetPosition,int targetSize){
  int unitSize=source.length;
  if (unitSize < targetSize) {
    int targetStart=(targetSize - unitSize) / 2;
    System.arraycopy(source,0,residuals,targetPosition + targetStart,source.length);
  }
 else {
    int sourcePosition=(unitSize - targetSize) / 2;
    System.arraycopy(source,sourcePosition,residuals,targetPosition,targetSize);
  }
}

public void copyResiduals ( byte [ ] source , int targetPosition , int targetSize ) { int unitSize = source . length ; if ( unitSize < targetSize ) { int targetStart = ( targetSize - unitSize ) / 2 ; System . arraycopy ( source , 0 , residuals , targetPosition + targetStart , source . length ) ; } else { int sourcePosition = ( unitSize - targetSize ) / 2 ; System . arraycopy ( source , sourcePosition , residuals , targetPosition , targetSize ) ; } }
copies the information in the given unit to the array of residuals , starting at the given index , up until targetsize chars .
