Esempio n. 1
0
 /**
  * Attempts to get the underlying value as an unsigned short. 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 2, then it cannot be converted to an unsigned short.
  *
  * @return The byte array value as an unsigned short
  * @throws TlvConvertException Thrown if the underlying byte array cannot be converted to an
  *     unsigned short.
  */
 public int getValueAsUnsignedShort() throws TlvConvertException {
   try {
     return ByteArrayUtil.toUnsignedShort(this.value);
   } catch (IllegalArgumentException e) {
     throw new TlvConvertException("unsigned short", e.getMessage());
   }
 }