Parses the specified string and returns a Byte instance if the string can be decoded into a single byte value. The string may be an optional minus sign "-" followed by a hexadecimal ("0x..." or "#..."), octal ("0..."), or decimal ("...") representation of a byte. @param string a
(String string)
| 127 | * if {@code string} can not be parsed as a byte value. |
| 128 | */ |
| 129 | public static Byte decode(String string) throws NumberFormatException { |
| 130 | int intValue = Integer.decode(string).intValue(); |
| 131 | byte result = (byte) intValue; |
| 132 | if (result == intValue) { |
| 133 | return valueOf(result); |
| 134 | } |
| 135 | throw new NumberFormatException(); |
| 136 | } |
| 137 | |
| 138 | @Override |
| 139 | public double doubleValue() { |