protected final void loadFromStrip(int n,int size,int w,Raster raster){
  byte[] bArray=new byte[size];
  ByteBuffer bbuf=ByteBuffer.allocateDirect(size);
  bbuf.order(byteOrder);
  int row=0;
  int h=0;
  for (int i=0; i < n; ++i) {
    bbuf.rewind();
    long as=readStrip(i,bbuf,size);
    if (as == -1) {
      throw new IllegalStateException(getTIFFError());
    }
    bbuf.rewind();
    bbuf.get(bArray);
    h=(int)(as / (w * bytesPerSample));
    raster.set(row,h,bArray);
    row+=h;
    Thread.yield();
  }
}

protected final void loadFromStrip ( int n , int size , int w , Raster raster ) { byte [ ] bArray = new byte [ size ] ; ByteBuffer bbuf = ByteBuffer . allocateDirect ( size ) ; bbuf . order ( byteOrder ) ; int row = 0 ; int h = 0 ; for ( int i = 0 ; i < n ; ++ i ) { bbuf . rewind ( ) ; long as = readStrip ( i , bbuf , size ) ; if ( as == - 1 ) { throw new IllegalStateException ( getTIFFError ( ) ) ; } bbuf . rewind ( ) ; bbuf . get ( bArray ) ; h = ( int ) ( as / ( w * bytesPerSample ) ) ; raster . set ( row , h , bArray ) ; row += h ; Thread . yield ( ) ; } }
load bytes from a strip into a raster .
