Note that methods in here are somewhat optimized, but not ridiculously so. Reason is that conversion method results are expected to be cached so that these methods will not be hot spots during normal operation.
| Modifier and Type | Field and Description |
|---|---|
| private static final byte[] | |
| private static final char[] | |
| private static final JsonStringEncoder | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private int | |
| private int | |
| private int | |
| private static int | |
| private static void | |
| pack-priv static int | |
| pack-priv static int | |
| private char[] | |
| public byte[] | Returns: UTF-8 encoded bytes oftext (without any escaping)Value text)String to processWill encode given String as UTF-8 (without any escaping) and return the resulting byte array. |
| public byte[] | Returns: UTF-8 encoded bytes oftext (without any escaping)Value text)CharSequence to processOverloaded variant of |
| public static JsonStringEncoder | Returns: Static stateless encoder instanceFactory method for getting an instance; this is either recycled per-thread instance, or a newly constructed one. |
| public char[] | Returns: JSON-escaped String matchinginputValue String to process input)Method that will escape text contents using JSON standard escaping, and return results as a character array. |
| public char[] | Returns: JSON-escaped String matchinginputValue input)CharSequence to processOverloaded variant of |
| public void | quoteAsString(CharSequence
Value input, StringBuilder CharSequence to processStringBuilder to append escaped contents toMethod that will quote text contents using JSON standard quoting,
and append results to a supplied |
| public byte[] | Returns: UTF-8 encoded bytes of JSON-escapedtextValue text)String to processMethod that will escape text contents using JSON standard escaping, encode resulting String as UTF-8 bytes and return results as a byte array. |
| HB | back to summary |
|---|---|
| private static final byte[] HB | |
| HC | back to summary |
|---|---|
| private static final char[] HC | |
| instance | back to summary |
|---|---|
| private static final JsonStringEncoder instance | |
| MAX_BYTE_BUFFER_SIZE | back to summary |
|---|---|
| pack-priv static final int MAX_BYTE_BUFFER_SIZE | |
| MAX_CHAR_BUFFER_SIZE | back to summary |
|---|---|
| pack-priv static final int MAX_CHAR_BUFFER_SIZE | |
| MIN_BYTE_BUFFER_SIZE | back to summary |
|---|---|
| pack-priv static final int MIN_BYTE_BUFFER_SIZE | |
| MIN_CHAR_BUFFER_SIZE | back to summary |
|---|---|
| pack-priv static final int MIN_CHAR_BUFFER_SIZE | |
| SURR1_FIRST | back to summary |
|---|---|
| private static final int SURR1_FIRST | |
| SURR1_LAST | back to summary |
|---|---|
| private static final int SURR1_LAST | |
| SURR2_FIRST | back to summary |
|---|---|
| private static final int SURR2_FIRST | |
| SURR2_LAST | back to summary |
|---|---|
| private static final int SURR2_LAST | |
| JsonStringEncoder | back to summary |
|---|---|
| public JsonStringEncoder() | |
| _appendByte | back to summary |
|---|---|
| private int _appendByte(int ch, int esc, ByteArrayBuilder bb, int ptr) | |
| _appendNamed | back to summary |
|---|---|
| private int _appendNamed(int esc, char[] qbuf) | |
| _appendNumeric | back to summary |
|---|---|
| private int _appendNumeric(int value, char[] qbuf) | |
| _convert | back to summary |
|---|---|
| private static int _convert(int p1, int p2) | |
| _illegal | back to summary |
|---|---|
| private static void _illegal(int c) | |
| _initialByteBufSize | back to summary |
|---|---|
| pack-priv static int _initialByteBufSize(int strLen) | |
| _initialCharBufSize | back to summary |
|---|---|
| pack-priv static int _initialCharBufSize(int strLen) | |
| _qbuf | back to summary |
|---|---|
| private char[] _qbuf() | |
| encodeAsUTF8 | back to summary |
|---|---|
| public byte[] encodeAsUTF8(String text) Will encode given String as UTF-8 (without any escaping) and return the resulting byte array.
| |
| encodeAsUTF8 | back to summary |
|---|---|
| public byte[] encodeAsUTF8(CharSequence text) Overloaded variant of
| |
| getInstance | back to summary |
|---|---|
| public static JsonStringEncoder getInstance() Factory method for getting an instance; this is either recycled per-thread instance, or a newly constructed one.
| |
| quoteAsString | back to summary |
|---|---|
| public char[] quoteAsString(String input) Method that will escape text contents using JSON standard escaping, and return results as a character array.
| |
| quoteAsString | back to summary |
|---|---|
| public char[] quoteAsString(CharSequence input) Overloaded variant of
| |
| quoteAsString | back to summary |
|---|---|
| public void quoteAsString(CharSequence input, StringBuilder output) Method that will quote text contents using JSON standard quoting,
and append results to a supplied
| |
| quoteAsUTF8 | back to summary |
|---|---|
| public byte[] quoteAsUTF8(String text) Method that will escape text contents using JSON standard escaping, encode resulting String as UTF-8 bytes and return results as a byte array.
| |