UTF16 byte arrays have the identical layout as char arrays. They share the same base offset and scale, and for each two-byte unit interpreted as a char, it has the same endianness as a char, which is the platform endianness. This is ensured in the static initializer of StringUTF16.
Unless stated otherwise, all methods assume that
byte[] arguments denote a UTF-16 string byte array
int) are in number of
characters, i.e., the number of
Unicode code units for UTF-16 strings, and the
number of bytes/chars for Latin-1 strings
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static char | |
| pack-priv static void | |
| private static void | checkBytesLength(int
a UTF-16 string byte array length length)Checks if the provided length is a valid UTF-16 string byte array length. |
| private static void | |
| private static void | |
| pack-priv static int | |
| pack-priv static int | |
| pack-priv static int | |
| private static int | |
| pack-priv static int | |
| pack-priv static int | |
| private static int | |
| pack-priv static int | |
| pack-priv static int | |
| private static int | |
| pack-priv static byte | |
| private static int | |
| pack-priv static int | Returns: 0 if value is equal to other, a value
less than 0 if value is lexicographically less than
other; a value greater than 0 otherwise.a UTF-16 string byte array value, byte[] a UTF-16 string byte array other)Lexicographically compares two UTF-16 strings as specified in
|
| pack-priv static int | compareTo(byte[]
a UTF-16 string byte array value, byte[] a UTF-16 string byte array other, int the number of characters in len1, int value to comparethe number of characters in len2)other to compareLexicographically compares two UTF-16 string prefixes as specified in
|
| private static int | |
| pack-priv static int | |
| pack-priv static int | |
| private static int | |
| pack-priv static int | |
| private static int | |
| pack-priv static int | |
| pack-priv static int | Returns: 0 if value is equal to other, a value
less than 0 if value is lexicographically less than
other; a value greater than 0 otherwise.a UTF-16 string byte array value, byte[] a Latin-1 string byte array other)Lexicographically compares a UTF-16 string to a Latin-1 one as specified
in |
| pack-priv static int | Returns: 0 if the value prefix is equal to the
other prefix, a value less than 0 if the value
prefix is lexicographically less than the other prefix; a
value greater than 0 otherwise.a UTF-16 string byte array value, byte[] a Latin-1 string byte array other, int the number of characters from len1, int value to comparethe number of characters from len2)other to compareLexicographically compares a UTF-16 string prefix to a Latin-1 one as
specified in |
| private static int | |
| private static int | |
| pack-priv static byte[] | Returns: Compress the char array (containing UTF16) into a compact strings byte arraya char array val, final int starting offset off, final int count of chars to be compressed, count)count > 0Returns Compress the char array (containing UTF16) into a compact strings byte array. |
| pack-priv static byte[] | Returns: Compress the internal byte array (containing UTF16) into a compact strings byte arraya byte array with UTF16 coding val, final int starting offset off, final int count of chars to be compressed, count)count > 0Returns Compress the internal byte array (containing UTF16) into a compact strings byte array. |
| pack-priv static byte[] | Returns: compress the code points into a compact strings byte arrayan int array of code points val, int starting offset off, final int length of code points to be compressed, length > 0 count)Returns compress the code points into a compact strings byte array. |
| pack-priv static int | Returns: the number of characters copiedthe source src, int char arraythe index (inclusive) of the first character in srcOff, byte[] srcthe target Latin-1 string byte array dst, int the index (inclusive) of the first character in dstOff, int dstthe maximum number of characters to copy len)Copies the prefix of Latin-1 characters from a |
| pack-priv static int | Returns: the number of characters copiedthe source UTF-16 string byte array src, int the index (inclusive) of the first character in srcOff, byte[] srcthe target Latin-1 string byte array dst, int the index (inclusive) of the first character in dstOff, int dstthe maximum number of characters to copy len)Copies the prefix of Latin-1 characters from a UTF-16 string byte array sub-range to a Latin-1 one. |
| private static int | |
| private static int | |
| private static int | |
| pack-priv static boolean | |
| pack-priv static boolean | |
| private static byte[] | |
| pack-priv static void | |
| pack-priv static char | Returns: the code point at the the specified position of the provided UTF-16 string byte arraya UTF-16 string byte array val, int the index of the character to get the code point from index)Returns the code point at the the specified position of the provided UTF-16 string byte array. |
| pack-priv static void | getChars(byte[]
the source UTF-16 string byte array to copy from value, int the index (inclusive) of the first character in the source sub-range srcBegin, int the index (exclusive) of the last character in the source sub-range srcEnd, char[] the target character array to copy to dst, int the index (inclusive) of the first character in the target sub-range dstBegin)Copies the specified sub-range of characters from a UTF-16 string byte array to the specified character array sub-range. |
| private static void | |
| pack-priv static int | |
| pack-priv static int | Returns: the index of the first character matching the provided one in the given UTF-16 string byte array sub-range;-1 otherwisea UTF-16 string byte array to search in value, int a character to search for ch, int the index (inclusive) of the first character in the sub-range fromIndex, int the index (exclusive) of the last character in the sub-range toIndex)Returns the index of the first character matching the provided one in
the given UTF-16 string byte array sub-range; |
| pack-priv static int | Returns: the index of the first character of the matchingvalue
sub-range if a match is found; -1 otherwisea UTF-16 string byte array to search in value, byte[] a UTF-16 string byte array to search for str)Searches for the first occurrence of |
| pack-priv static int | Returns: the index of the first character of the matchingvalue
sub-range if a match is found; -1 otherwisea UTF-16 string byte array to search in value, int the index (exclusive) of the last character in valueToIndex, byte[] valuea UTF-16 string byte array to search for str, int the index (exclusive) of the last character in strToIndex, int strthe index (inclusive) of the first character in valueFromIndex)valueSearches for the first occurrence of the given |
| private static int | |
| private static int | |
| private static int | |
| pack-priv static int | Returns: the index of the first character of the matchingvalue
sub-range if a match is found; -1 otherwisea UTF-16 string byte array to search in value, byte[] a Latin-1 string byte array to search for str)Searches for the first occurrence of the given Latin-1 string byte array
|
| pack-priv static int | Returns: the index of the first character of the matchingsrc
sub-range if a match is found; -1 otherwisea UTF-16 string byte array to search in src, int the index (exclusive) of the last character in srcToIndex, byte[] srca Latin-1 string byte array to search for tgt, int the index (exclusive) of the last character in tgtToIndex, int tgtthe index (inclusive) of the first character in tgtFromIndex)srcSearches for the first occurrence of the given Latin-1 string byte array
|
| private static int | |
| private static int | |
| private static int | |
| pack-priv static int | |
| private static int | indexOfSupplementary(byte[] value, int ch, int fromIndex, int max)
Handles (rare) calls of indexOf with a supplementary character. |
| private static int | |
| pack-priv static int | |
| pack-priv static int | |
| pack-priv static int | |
| pack-priv static int | |
| private static int | lastIndexOfSupplementary(final byte[] value, int ch, int fromIndex)
Handles (rare) calls of lastIndexOf with a supplementary character. |
| pack-priv static int | |
| pack-priv static Stream | |
| pack-priv static byte[] | |
| private static int | |
| pack-priv static String | |
| pack-priv static void | putChar(byte[]
a UTF-16 string byte array val, int the index of the character to write the code point to index, int a code point c)Writes the given code point to the specified position of the provided UTF-16 string byte array. |
| pack-priv static void | |
| pack-priv static void | |
| pack-priv static void | |
| pack-priv static void | |
| pack-priv static void | |
| pack-priv static boolean | |
| pack-priv static boolean | |
| pack-priv static String | |
| pack-priv static String | replace(byte[] value, int valLen, boolean valLat1, byte[] targ, int targLen, boolean targLat1, byte[] repl, int replLen, boolean replLat1)
|
| pack-priv static void | |
| private static void | |
| pack-priv static String | |
| pack-priv static String | |
| pack-priv static String | |
| pack-priv static byte[] | Returns: a UTF-16 string byte array produced by encoding the characters in the provided character array sub-rangea character array to encode value, int the index of the character to start encoding from off, int the number of characters to encode len)Returns a UTF-16 string byte array produced by encoding the characters in the provided character array sub-range. |
| pack-priv static byte[] | |
| pack-priv static byte[] | |
| private static byte[] | |
| pack-priv static byte[] | |
| pack-priv static char[] | |
| pack-priv static String | |
| private static String | toLowerCaseEx(String str, byte[] value, byte[] result, int first, Locale locale, boolean localeDependent)
|
| pack-priv static String | |
| private static String | toUpperCaseEx(String str, byte[] value, byte[] result, int first, Locale locale, boolean localeDependent)
|
| pack-priv static String |