示例#1
0
 /**
  * Attempts to get the underlying value as an int. If the underlying byte array cannot be
  * converted, then an exception is thrown. For example, if the underlying byte array isn't a
  * length of 4, then it cannot be converted to an int.
  *
  * @return The byte array value as an int
  * @throws TlvConvertException Thrown if the underlying byte array cannot be converted to an int.
  */
 public int getValueAsInt() throws TlvConvertException {
   try {
     return ByteArrayUtil.toInt(this.value);
   } catch (IllegalArgumentException e) {
     throw new TlvConvertException("int", e.getMessage());
   }
 }