code: static public int asIntValue(byte[] array) {
  
          if (null == array) {
              return -1;
          }
  
          int intVal = 0;
          int mark = 1;
          int digit;
          int i = array.length - 1;
          for (; 0 <= i; i--) {
              digit = array[i] - HEX_BYTES[0];
              if (0 > digit || 9 < digit) {
                  // stop on any nondigit, if it's not a DASH then throw an exc
                  if ('-' != array[i]) {
                      throw new NumberFormatException("Invalid digit: " + array[i]);
                  }
                  break;
              }
              intVal += digit * mark;
              mark *= 10;
          }
  
          // check for negative numbers
          if (0 <= i && array[i] == '-') {
              intVal = -intVal;
          }
  
          return intVal;
      }
docs: Take an input byte[] and return the int translation. For example, the
  byte[] '0053' would return 53.
  
  @param array
  @return int
  @throws NumberFormatException
  (if the data contains invalid digits)