public Integer Byte4ToInt32(byte[] bytes) throws Exception {
    if (bytes.length != 4) throw new Exception("aBytes.length != 4");
    /*** forward algorithm [123][0][0][0] ***/
    Integer result = new Integer(0);
    byte i = 3;
    while(true) {
      result |= bytes[i] & 0xFF;
      if (i == 0) break;
      result <<= 8;
      i--;
    }
    return result;

    /*** inverse algorithm 0 0 0 123 ***
    int l = 0;
    int tmpI = 0;
    while(true) {
      l |= aBytes[tmpI] & 0xFF;
      if (tmpI > 2) break;
      l <<= 8;
      tmpI++;
    }
    return l;
    ***************************/
  }