private boolean isInterleaved(ComponentSampleModel sm){
  int numBands=sampleModel.getNumBands();
  if (numBands == 1) {
    return true;
  }
  int[] bankIndices=sm.getBankIndices();
  for (int i=0; i < numBands; i++) {
    if (bankIndices[i] != 0) {
      return false;
    }
  }
  int[] bandOffsets=sm.getBandOffsets();
  int minOffset=bandOffsets[0];
  int maxOffset=minOffset;
  for (int i=1; i < numBands; i++) {
    int offset=bandOffsets[i];
    if (offset < minOffset) {
      minOffset=offset;
    }
    if (offset > maxOffset) {
      maxOffset=offset;
    }
  }
  if (maxOffset - minOffset >= sm.getPixelStride()) {
    return false;
  }
  return true;
}

private boolean isInterleaved ( ComponentSampleModel sm ) { int numBands = sampleModel . getNumBands ( ) ; if ( numBands == 1 ) { return true ; } int [ ] bankIndices = sm . getBankIndices ( ) ; for ( int i = 0 ; i < numBands ; i ++ ) { if ( bankIndices [ i ] != 0 ) { return false ; } } int [ ] bandOffsets = sm . getBandOffsets ( ) ; int minOffset = bandOffsets [ 0 ] ; int maxOffset = minOffset ; for ( int i = 1 ; i < numBands ; i ++ ) { int offset = bandOffsets [ i ] ; if ( offset < minOffset ) { minOffset = offset ; } if ( offset > maxOffset ) { maxOffset = offset ; } } if ( maxOffset - minOffset >= sm . getPixelStride ( ) ) { return false ; } return true ; }
analyzes a componentsamplemodel to determine if it can function as a pixelinterleavedsamplemodel . in order to do so , it must use only bank 0 of its databuffer , and the data offsets must span a range of less than pixelstride . < p > these properties are trivially true for a 1 - banded samplemodel .
