class CSSEncoder extends Encoder
Modifier and Type | Class and Description |
---|---|
(package private) static class |
CSSEncoder.Mode
Encoding mode of operation--specified the set of characters that
required encoding.
|
Modifier and Type | Field and Description |
---|---|
(package private) long |
_highMask
The bit-mask of unescaped characters in the range 64 to 127.
|
(package private) long |
_lowMask
The bit-mask of unescaped characters in the range 0 to 63.
|
(package private) CSSEncoder.Mode |
_mode
The mode of operation, used primarily for toString.
|
(package private) static int |
HEX_ENCODED_LENGTH
Length of hex encoding with trailing space
"\## " . |
(package private) static char |
INVALID_REPLACEMENT_CHARACTER
Character used when an invalid characters is found.
|
(package private) static int |
LONG_BITS
Number of bits in a
long . |
Constructor and Description |
---|
CSSEncoder(CSSEncoder.Mode mode)
Creates an encoder for the specified mode of operation.
|
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. |
java.lang.String |
toString() |
encode, encodeBuffers, overflow, underflow
static final int LONG_BITS
long
.static final int HEX_ENCODED_LENGTH
"\## "
.static final char INVALID_REPLACEMENT_CHARACTER
final long _lowMask
final long _highMask
final CSSEncoder.Mode _mode
CSSEncoder(CSSEncoder.Mode mode)
mode
- the mode of the encoder.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 encodepublic java.lang.String toString()
toString
in class java.lang.Object