Package org.rocksdb.util
Class ByteUtil
- java.lang.Object
-
- org.rocksdb.util.ByteUtil
-
public class ByteUtil extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ByteUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]bytes(java.lang.String str)Convert a String to a UTF-8 byte array.static intmemcmp(java.nio.ByteBuffer x, java.nio.ByteBuffer y, int count)Compares the firstcountbytes of two areas of memory.
-
-
-
Method Detail
-
bytes
public static byte[] bytes(java.lang.String str)
Convert a String to a UTF-8 byte array.- Parameters:
str- the string- Returns:
- the byte array.
-
memcmp
public static int memcmp(java.nio.ByteBuffer x, java.nio.ByteBuffer y, int count)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
-
-