public class Utf8 extends Object
Constructor and Description |
---|
Utf8() |
Modifier and Type | Method and Description |
---|---|
static boolean |
containsUnicode(String string) |
static int |
encodedLength(CharSequence sequence)
Returns the number of bytes in the UTF-8-encoded form of
sequence . |
public static boolean containsUnicode(String string)
public static int encodedLength(CharSequence sequence)
sequence
. For a string, this
method is equivalent to string.getBytes(UTF_8).length
, but is more efficient in both
time and space.sequence
- the CharSequence to measureIllegalArgumentException
- if sequence
contains ill-formed UTF-16 (unpaired
surrogates)Copyright © 2018 Brett Wooldridge. All rights reserved.