MCPcopy Create free account
hub / github.com/davidgiven/luje / parseByte

Method parseByte

lib/java/lang/Byte.java:190–197  ·  view source on GitHub ↗

Parses the specified string as a signed decimal byte value. The ASCII character \u002d ('-') is recognized as the minus sign. @param string the string representation of a single byte value. @return the primitive byte value represented by string. @throws NumberFormatException

(String string)

Source from the content-addressed store, hash-verified

188 * can not be parsed as a byte value.
189 */
190 public static byte parseByte(String string) throws NumberFormatException {
191 int intValue = Integer.parseInt(string);
192 byte result = (byte) intValue;
193 if (result == intValue) {
194 return result;
195 }
196 throw new NumberFormatException();
197 }
198
199 /**
200 * Parses the specified string as a signed byte value using the specified

Callers 2

ByteMethod · 0.95
valueOfMethod · 0.95

Calls 1

parseIntMethod · 0.95

Tested by

no test coverage detected