abstract class OptimizedUTF8Encoder extends Encoding
CharsetDecoder
.Modifier and Type | Field and Description |
---|---|
private char[] |
decoderArray |
private static int |
MAX_CODE_POINT |
private static int |
MIN_2_BYTES |
private static int |
MIN_3_BYTES |
private static int |
MIN_4_BYTES |
private int |
thresholdSize |
(package private) static java.nio.charset.Charset |
UTF_8_CHARSET |
Constructor and Description |
---|
OptimizedUTF8Encoder() |
Modifier and Type | Method and Description |
---|---|
(package private) java.lang.String |
charDecode(byte[] encodedString,
int offset,
int length)
Decodes binary content to
String by first converting to char[] . |
private static void |
checkByte(int ch,
int pos,
int len) |
private static void |
checkMinimal(int ch,
int minValue) |
(package private) static java.lang.String |
decodeToChars(byte[] data,
int offset,
int length,
char[] chars,
int out)
Decodes data from offset with given length as utf-8 and
gives each decoded code point to the codePointConsumer.
|
(package private) char[] |
getCharArray(int size)
Returns a
char[] to use for decoding. |
decode, decode, defaultEncoding, encode, getDatabaseEncoding, getDecodingReader, getEncodingWriter, getJVMEncoding, hasAsciiNumbers, name, toString
static final java.nio.charset.Charset UTF_8_CHARSET
private static final int MIN_2_BYTES
private static final int MIN_3_BYTES
private static final int MIN_4_BYTES
private static final int MAX_CODE_POINT
private final int thresholdSize
private char[] decoderArray
char[] getCharArray(int size)
char[]
to use for decoding. Will use member variable if size
is small enough. This method must be called, and returned char[]
only used, from
synchronized
block.size
- The needed size of returned char[]
.char[]
at least as long as length.java.lang.String charDecode(byte[] encodedString, int offset, int length) throws java.io.IOException
String
by first converting to char[]
.java.io.IOException
static java.lang.String decodeToChars(byte[] data, int offset, int length, char[] chars, int out) throws java.io.IOException
data
- The byte[]
to decode.offset
- The starting index in data.length
- The number of bytes in data to decode.codePointConsumer
- The consumer of all decoded code points.java.io.IOException
- If data is not valid utf-8 content.private static void checkByte(int ch, int pos, int len) throws java.io.IOException
java.io.IOException
private static void checkMinimal(int ch, int minValue) throws java.io.IOException
java.io.IOException