code: public static int getValueAsInt(byte[] key, Map<byte[], byte[]> infoValues) {
      byte[] value = infoValues.get(key);
      if (value != null) {
        try {
          int retValue = Bytes.toInt(value);
          return retValue;
        } catch (NumberFormatException nfe) {
          LOG.error("Caught NFE while converting to int ", nfe);
          return 0;
        } catch (IllegalArgumentException iae) {
          // for exceptions like java.lang.IllegalArgumentException:
          // offset (0) + length (8) exceed the capacity of the array: 7
          LOG.error("Caught IAE while converting to int ", iae);
          return 0;
        }
      } else {
        return 0;
      }
    }
docs: get value from a map as an int
  @param key
  @param infoValues
  @return int