|
|
От: |
DK3981
|
|
| Дата: | 23.05.06 13:02 | ||
| Оценка: | |||
DD>// обратный перевод - в следущей строке вылетает Exception
DD>long a = Long.decode("0x" + strBuffer.toString());
DD>strBuffer.delete(0, strBuffer.length());
DD>strBuffer.append(Long.toString(a));
DD>Для отрицательных чисел надо использовать знак — в начале: decode("-0x64") даст в результате -100.The sequence of characters following an (optional) negative sign and/or radix specifier ("0x", "0X", "#", or leading zero) is parsed as by the Long.parseLong method with the indicated radix (10, 16, or 8). This sequence of characters must represent a positive value or a NumberFormatException will be thrown. The result is negated if first character of the specified String is the minus sign. No whitespace characters are permitted in the String.