code: public static int getIntFromBytes(byte[] bytes,
                                        int    offset,
                                        int    byteCount)
      {
          int value = 0;
  
          switch (byteCount)
          {
              case 4: value |= ( bytes[offset + 3] & 0xFF);
              case 3: value |= ((bytes[offset + 2] & 0xFF) << 8);
              case 2: value |= ((bytes[offset + 1] & 0xFF) << 16);
              case 1: value |= ((bytes[offset + 0] & 0xFF) << 24);
                      value = value >> ((4 - byteCount) * 8);
                  break;
              default:
                  final String msg = "byteCount is not between 1 and 4";
                  IllegalArgumentException iae = new IllegalArgumentException(msg);
                  FFDCFilter.processException(
                      iae,
                      "com.ibm.ws.Transaction.JTA.Util.getIntFromBytes",
                      "553");
                  throw iae;
          }
  
          return value;
      }
docs: Read one to four bytes (big-endian) from a byte array and convert
  to an integer.
  
  @param bytes input byte array
  @param offset offset of integer value
  @param byteCount number of bytes in value (1 <= byteCount <= 4)
  
  @return value of the number