在java中 我有两个变量
String string;
int integerValue;
我想将这些值转换为unsignedbyte 那是 如何将字符串转换为UnsignedByte 和 整数到UnsignedByte
答案 0 :(得分:1)
Java没有无符号字节。
从字符串转换为short
由Short.parseShort(string)
如果您指的是Axis的UnsignedByte
类,您可以使用构造函数:
new UnsignedByte(sting);
new UnsignedByte(integerValue);
答案 1 :(得分:0)
Java没有像unsigned byte这样的类型,你必须使用更大的short(对于unsigned int,它必须很长)。
short s = (short) integerValue;