int pixelStride = getNumComponents();
int pixelStride, scanlineStride; int[] bandOffsets;  pixelStride = getNumComponents(); scanlineStride = pixelStride * w;   bandOffsets = new int[pixelStride]; for (int i = 0; i < pixelStride; i++) bandOffsets[i] = i;   switch (transferType) { case DataBuffer.TYPE_BYTE: case DataBuffer.TYPE_USHORT: return new PixelInterleavedSampleModel(transferType, w, h, pixelStride, scanlineStride, bandOffsets);
  public SampleModel createCompatibleSampleModel(int w, int h)  {    int pixelStride = getNumComponents();        /* TODO: Maybe we don't need to create a new offset array each       time, but rather use the same array every time. */    int[] bandOffsets = new int[pixelStride];    for (int i=0; i<pixelStride; i++) bandOffsets[i] = i;    return new ComponentSampleModel(transferType, w, h,				    pixelStride, pixelStride*w,				    bandOffsets);  }