MCPcopy Create free account
hub / github.com/antlr/codebuff / fromByteArray

Method fromByteArray

output/java_guava/1.4.18/Ints.java:332–336  ·  view source on GitHub ↗

Returns the int value whose big-endian representation is stored in the first 4 bytes of bytes; equivalent to ByteBuffer.wrap(bytes).getInt(). For example, the input byte array {0x12, 0x13, 0x14, 0x15, 0x33} would yield the int value 0x12131415. Arg

(byte[] bytes)

Source from the content-addressed store, hash-verified

330 */
331
332 @GwtIncompatible // doesn't work
333 public static int fromByteArray(byte[] bytes) {
334 checkArgument(bytes.length >= BYTES, "array too small: %s < %s", bytes.length, BYTES);
335 return fromBytes(bytes[0], bytes[1], bytes[2], bytes[3]);
336 }
337
338 /**
339 * Returns the {@code int} value whose byte representation is the given 4 bytes, in big-endian

Callers

nothing calls this directly

Calls 2

fromBytesMethod · 0.95
checkArgumentMethod · 0.45

Tested by

no test coverage detected