class JavaEncoder extends Encoder
Modifier and Type | Field and Description |
---|---|
(package private) static int |
OCT_ESCAPE_LENGTH
The length of a octal escape sequence, e.g.
|
(package private) static int |
OCT_MASK
The bit-mask for an octal unit.
|
(package private) static int |
OCT_SHIFT
Number of bits to shift for each octal unit.
|
(package private) static int |
U_ESCAPE_LENGTH
The length of a Unicode escape, e.g.
|
Constructor and Description |
---|
JavaEncoder() |
Modifier and Type | Method and Description |
---|---|
protected java.nio.charset.CoderResult |
encodeArrays(java.nio.CharBuffer input,
java.nio.CharBuffer output,
boolean endOfInput)
The core encoding loop used when both the input and output buffers
are array backed.
|
protected int |
firstEncodedOffset(java.lang.String input,
int off,
int len)
Scans the input string for the first character index that requires
encoding.
|
protected int |
maxEncodedLength(int n)
Returns the maximum encoded length (in chars) of an input sequence of
n characters. |
encode, encodeBuffers, overflow, underflow
static final int U_ESCAPE_LENGTH
static final int OCT_ESCAPE_LENGTH
static final int OCT_SHIFT
static final int OCT_MASK
protected int maxEncodedLength(int n)
Encoder
n
characters.maxEncodedLength
in class Encoder
n
- the number of characters of inputprotected int firstEncodedOffset(java.lang.String input, int off, int len)
Encoder
firstEncodedOffset
in class Encoder
input
- the input to check for encodingoff
- the offset of the first character to checklen
- the number of characters to checkoff+len
if no characters in the input require encoding.protected java.nio.charset.CoderResult encodeArrays(java.nio.CharBuffer input, java.nio.CharBuffer output, boolean endOfInput)
Encoder
encodeArrays
in class Encoder
input
- the input buffer.output
- the output buffer.endOfInput
- when true, this is the last input to encode