public static String decStringToHexString(final String decString){
  Preconditions.checkNotNull(decString,"Error: Decimal string can't be null");
  return Long.toHexString(Long.valueOf(decString,16));
}

public static String decStringToHexString ( final String decString ) { Preconditions . checkNotNull ( decString , "Error: Decimal string can't be null" ) ; return Long . toHexString ( Long . valueOf ( decString , 16 ) ) ; }
converts a decimal string into a hexadecimal string . note that the decimal string value must fit into a long value .
