protected final void loadFromTile(int n,int size,int w,int h,Raster raster){
  ByteBuffer bbuf=ByteBuffer.allocateDirect(size);
  byte[] bArray=new byte[size];
  bbuf.order(byteOrder);
  int row=0, left=0, wid=0, hgt=0;
  for (int i=0; i < n; ++i) {
    bbuf.rewind();
    long len=readTile(i,bbuf,size);
    if (len == -1) {
      throw new IllegalStateException(getTIFFError());
    }
    bbuf.rewind();
    bbuf.get(bArray);
    wid=Math.min(w,rasterWidth - left);
    hgt=Math.min(h,rasterLength - row);
    raster.set(row,left,wid,hgt,bArray);
    left+=w;
    if (left >= rasterWidth) {
      left=0;
      row+=h;
    }
    Thread.yield();
  }
}

protected final void loadFromTile ( int n , int size , int w , int h , Raster raster ) { ByteBuffer bbuf = ByteBuffer . allocateDirect ( size ) ; byte [ ] bArray = new byte [ size ] ; bbuf . order ( byteOrder ) ; int row = 0 , left = 0 , wid = 0 , hgt = 0 ; for ( int i = 0 ; i < n ; ++ i ) { bbuf . rewind ( ) ; long len = readTile ( i , bbuf , size ) ; if ( len == - 1 ) { throw new IllegalStateException ( getTIFFError ( ) ) ; } bbuf . rewind ( ) ; bbuf . get ( bArray ) ; wid = Math . min ( w , rasterWidth - left ) ; hgt = Math . min ( h , rasterLength - row ) ; raster . set ( row , left , wid , hgt , bArray ) ; left += w ; if ( left >= rasterWidth ) { left = 0 ; row += h ; } Thread . yield ( ) ; } }
load data from a tile into a raster .
