public static long subAddressToLong(final String subaddress){
  Preconditions.checkNotNull(subaddress,"Argument subaddress can't be null.");
  if (subaddress.contains(".")) {
    final String[] parts=subaddress.split("\\.");
    Preconditions.checkArgument(parts.length == 2,"Argument subaddress is not a valid subaddress.");
    final long firstPart=Long.parseLong(parts[0]);
    final long secondPart=Long.parseLong(parts[1]);
    return (firstPart * 0x100) + secondPart;
  }
 else {
    throw new IllegalArgumentException("Argument subaddress is not a valid subaddress.");
  }
}

public static long subAddressToLong ( final String subaddress ) { Preconditions . checkNotNull ( subaddress , "Argument subaddress can't be null." ) ; if ( subaddress . contains ( "." ) ) { final String [ ] parts = subaddress . split ( "\\." ) ; Preconditions . checkArgument ( parts . length == 2 , "Argument subaddress is not a valid subaddress." ) ; final long firstPart = Long . parseLong ( parts [ 0 ] ) ; final long secondPart = Long . parseLong ( parts [ 1 ] ) ; return ( firstPart * 0x100 ) + secondPart ; } else { throw new IllegalArgumentException ( "Argument subaddress is not a valid subaddress." ) ; } }
converts a string that contains a subaddress into a long value with the same offset as the string . attention : a valid subaddress of the form " number . number " must be passed to the function or an exception is thrown .
