public class ByteUtil extends Object
| Constructor and Description |
|---|
ByteUtil() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
bytes(String str)
Convert a String to a UTF-8 byte array.
|
static int |
memcmp(ByteBuffer x,
ByteBuffer y,
int count)
Compares the first
count bytes of two areas of memory. |
public static byte[] bytes(String str)
str - the stringpublic static int memcmp(ByteBuffer x, ByteBuffer y, int count)
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.x - the first value to compare withy - the second value to compare againstcount - the number of bytes to compareCopyright © 2022. All rights reserved.