code: public static int byteArrToInt(byte[] b, int off) {
      int z = 0;
      for (int i = 3; i > 0; i--) {
        z = (z | (b[off + i] & INTFLAG)) << 8;
      }
      z = z | (b[off] & INTFLAG);
      return z;
    }
docs: -------------------------------------------------------------------