Package org.rocksdb.util
Class ByteUtil
java.lang.Object
org.rocksdb.util.ByteUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]Convert a String to a UTF-8 byte array.static intmemcmp(ByteBuffer x, ByteBuffer y, int count) Compares the firstcountbytes of two areas of memory.
-
Constructor Details
-
ByteUtil
public ByteUtil()
-
-
Method Details
-
bytes
Convert a String to a UTF-8 byte array.- Parameters:
str- the string- Returns:
- the byte array.
-
memcmp
Compares the firstcountbytes of two areas of memory. Returns zero if they are the same, a value less than zero ifxis lexically less thany, or a value greater than zero ifxis lexically greater thany. Note that lexical order is determined as if comparing unsigned char arrays. Similar to memcmp.c.- Parameters:
x- the first value to compare withy- the second value to compare againstcount- the number of bytes to compare- Returns:
- the result of the comparison
-