MCPcopy Create free account
hub / github.com/SquirrelJME/SquirrelJME / parseByte

Method parseByte

runt/apis/cldc-compact/java/lang/Byte.java:224–236  ·  view source on GitHub ↗

Parses the given byte using the given radix. @param __s The string to parse. @param __r The radix of the value. @return The parsed value. @throws NumberFormatException If the byte is not valid. @throws NullPointerException On null arguments. @since 2018/12/07

(String __s, int __r)

Source from the content-addressed store, hash-verified

222 * @since 2018/12/07
223 */
224 public static byte parseByte(String __s, int __r)
225 throws NumberFormatException, NullPointerException
226 {
227 if (__s == null)
228 throw new NullPointerException("NARG");
229
230 // {@squirreljme.error ZZ3f Byte value out of range.}
231 int val = Integer.parseInt(__s, __r);
232 if (val < MIN_VALUE || val > MAX_VALUE)
233 throw new NumberFormatException("ZZ3f");
234
235 return (byte)val;
236 }
237
238 /**
239 * Parses the given string to a byte.

Callers 2

ByteMethod · 0.95
valueOfMethod · 0.95

Calls 1

parseIntMethod · 0.95

Tested by

no test coverage detected