private int computeOffset(int x, int y) {
    if(y > x) {
      return computeOffset(y, x);
    }
    return ((x * (x + 1)) >> 1) + y;
  }
private int computeOffset ( int x , int y ) { if ( y > x ) { return computeOffset ( y , x ) ; } return ( ( x * ( x + 1 ) ) > > 1 ) + y ; }
Compute the offset within the file.

@param x First coordinate
@param y Second coordinate
@return Linear offset