The variant of UTF-8 implemented by this class is the restricted definition of UTF-8 introduced in Unicode 3.1. One implication of this is that it rejects "non-shortest form" byte sequences, even though the JDK decoder may accept them.
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static int | encodedLength(CharSequence sequence)
Returns the number of bytes in the UTF-8-encoded form of |
| private static int | |
| public static boolean | isWellFormed(byte[] bytes)
Returns |
| public static boolean | isWellFormed(byte[]
the input buffer bytes, int the offset in the buffer of the first byte to read off, int the number of bytes to read from the buffer len)Returns whether the given byte array slice is a well-formed UTF-8 byte sequence, as defined by
|
| private static boolean | |
| private static String |
| Utf8 | back to summary |
|---|---|
| private Utf8() | |
| encodedLength | back to summary |
|---|---|
| public static int encodedLength(CharSequence sequence) Returns the number of bytes in the UTF-8-encoded form of
| |
| encodedLengthGeneral | back to summary |
|---|---|
| private static int encodedLengthGeneral(CharSequence sequence, int start) | |
| isWellFormed | back to summary |
|---|---|
| public static boolean isWellFormed(byte[] bytes) Returns This method returns | |
| isWellFormed | back to summary |
|---|---|
| public static boolean isWellFormed(byte[] bytes, int off, int len) Returns whether the given byte array slice is a well-formed UTF-8 byte sequence, as defined by
| |
| isWellFormedSlowPath | back to summary |
|---|---|
| private static boolean isWellFormedSlowPath(byte[] bytes, int off, int end) | |
| unpairedSurrogateMsg | back to summary |
|---|---|
| private static String unpairedSurrogateMsg(int i) | |