public final class Utf8Utils
extends java.lang.Object
CONSTANT_Utf8_info.| Constructor and Description |
|---|
Utf8Utils() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
stringToUtf8Bytes(java.lang.String string)
Converts a string into its Java-style UTF-8 form.
|
static java.lang.String |
utf8BytesToString(byte[] bytes,
int start,
int length)
Converts an array of UTF-8 bytes into a string.
|
static java.lang.String |
utf8BytesWithUtf16LengthToString(byte[] bytes,
int start,
int utf16Length)
Converts an array of UTF-8 bytes into a string.
|
static java.lang.String |
utf8BytesWithUtf16LengthToString(byte[] bytes,
int start,
int utf16Length,
int[] readLength)
Converts an array of UTF-8 bytes into a string.
|
public static byte[] stringToUtf8Bytes(java.lang.String string)
string - non-null; the string to convertpublic static java.lang.String utf8BytesToString(byte[] bytes,
int start,
int length)
bytes - non-null; the bytes to convertstart - the start index of the utf8 string to convertlength - the length of the utf8 string to convert, not including any null-terminator that might be presentpublic static java.lang.String utf8BytesWithUtf16LengthToString(@Nonnull
byte[] bytes,
int start,
int utf16Length)
bytes - non-null; the bytes to convertstart - the start index of the utf8 string to convertutf16Length - the number of utf16 characters in the string to decodepublic static java.lang.String utf8BytesWithUtf16LengthToString(@Nonnull
byte[] bytes,
int start,
int utf16Length,
@Nullable
int[] readLength)
bytes - non-null; the bytes to convertstart - the start index of the utf8 string to convertutf16Length - the number of utf16 characters in the string to decodereadLength - If non-null, the first element will contain the number of bytes read after the method exits