[英]Signed int to 16 bit hex string in Java
I use this code 我用这个代码
short s = (short) Integer.parseInt("3321",16);
to convert from 3321
to 13089
从
3321
转换为13089
How can I make the inverse and convert from 13089
to 3321
? 如何进行逆向转换并从
13089
转换为3321
?
Integer
provides a method for this . Integer
为此提供了一种方法 。
String out = Integer.toHexString(13089);
out
will have the value "3321"
. out
将具有值"3321"
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.