protected final float meanFloat(int i,int j,int size){
  double sum=0;
  for (int r=i; r < (i + size); ++r) {
    mmbBuf.get(r,j * numBytes,size * numBytes,meanArray);
    for (int c=j; c < (j + size); ++c) {
      sum+=meanBuf.getFloat();
    }
    meanBuf.rewind();
  }
  return ((float)(sum / (size * size)));
}

protected final float meanFloat ( int i , int j , int size ) { double sum = 0 ; for ( int r = i ; r < ( i + size ) ; ++ r ) { mmbBuf . get ( r , j * numBytes , size * numBytes , meanArray ) ; for ( int c = j ; c < ( j + size ) ; ++ c ) { sum += meanBuf . getFloat ( ) ; } meanBuf . rewind ( ) ; } return ( ( float ) ( sum / ( size * size ) ) ) ; }
compute the mean of an area in a raster array .
