MCPcopy Create free account
hub / github.com/bytedance/terarkdb / byteToInt

Method byteToInt

java/src/test/java/org/rocksdb/Types.java:21–26  ·  view source on GitHub ↗

Convert first 4 bytes of a byte array to an int @param data The byte array @return An integer

(final byte data[])

Source from the content-addressed store, hash-verified

19 * @return An integer
20 */
21 public static int byteToInt(final byte data[]) {
22 return (data[0] & 0xff) |
23 ((data[1] & 0xff) << 8) |
24 ((data[2] & 0xff) << 16) |
25 ((data[3] & 0xff) << 24);
26 }
27
28 /**
29 * Convert an int to 4 bytes

Callers 3

testRoundtripMethod · 0.80
testRoundtripCfMethod · 0.80
compareIntKeysMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected