public static short toUnsignedByte(byte[] bytes) { checkBytesNotNull(bytes); return toUnsignedByte(bytes, 0, bytes.length); }
/** * Attempts to get the underlying value as an unsigned byte. 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 1, then it cannot be * converted to an unsigned byte. * @return The byte array value as an unsigned byte * @throws TlvConvertException Thrown if the underlying byte array cannot * be converted to an unsigned byte. */ public short getValueAsUnsignedByte() throws TlvConvertException { try { return ByteArrayUtil.toUnsignedByte(this.value); } catch (IllegalArgumentException e) { throw new TlvConvertException("unsigned byte", e.getMessage()); } }
public static short toUnsignedByte(byte[] bytes) { checkBytesNotNull(bytes); return toUnsignedByte(bytes, 0, bytes.length); }
/** * Attempts to get the underlying value as an unsigned byte. 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 1, then it cannot be * converted to an unsigned byte. * @return The byte array value as an unsigned byte * @throws TlvConvertException Thrown if the underlying byte array cannot * be converted to an unsigned byte. */ public short getValueAsUnsignedByte() throws TlvConvertException { try { return ByteArrayUtil.toUnsignedByte(this.value); } catch (IllegalArgumentException e) { throw new TlvConvertException("unsigned byte", e.getMessage()); } }
/** * Attempts to get the underlying value as an unsigned byte. 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 1, then it cannot be * converted to an unsigned byte. * @return The byte array value as an unsigned byte * @throws TlvConvertException Thrown if the underlying byte array cannot * be converted to an unsigned byte. */ public short getValueAsUnsignedByte() throws TlvConvertException { try { return ByteArrayUtil.toUnsignedByte(this.value); } catch (IllegalArgumentException e) { throw new TlvConvertException("unsigned byte", e.getMessage()); } }
/** * Attempts to get the underlying value as an unsigned byte. 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 1, then it cannot be * converted to an unsigned byte. * @return The byte array value as an unsigned byte * @throws TlvConvertException Thrown if the underlying byte array cannot * be converted to an unsigned byte. */ public short getValueAsUnsignedByte() throws TlvConvertException { try { return ByteArrayUtil.toUnsignedByte(this.value); } catch (IllegalArgumentException e) { throw new TlvConvertException("unsigned byte", e.getMessage()); } }