Class ByteUtil

java.lang.Object
org.rocksdb.util.ByteUtil

public class ByteUtil extends Object
  • Constructor Details

    • ByteUtil

      public ByteUtil()
  • Method Details

    • bytes

      public static byte[] bytes(String str)
      Convert a String to a UTF-8 byte array.
      Parameters:
      str - the string
      Returns:
      the byte array.
    • memcmp

      public static int memcmp(ByteBuffer x, ByteBuffer y, int count)
      Compares the first count bytes of two areas of memory. Returns zero if they are the same, a value less than zero if x is lexically less than y, or a value greater than zero if x is lexically greater than y. Note that lexical order is determined as if comparing unsigned char arrays. Similar to memcmp.c.
      Parameters:
      x - the first value to compare with
      y - the second value to compare against
      count - the number of bytes to compare
      Returns:
      the result of the comparison