Class Utf8Generator

    • Field Detail

      • sOutputEscapes

        protected static final int[] sOutputEscapes
        This is the default set of escape codes, over 7-bit ASCII range (first 128 character codes), used for single-byte UTF-8 characters.
      • _ioContext

        protected final IOContext _ioContext
      • _outputStream

        protected final OutputStream _outputStream
        Underlying output stream used for writing JSON content.
      • _outputEscapes

        protected int[] _outputEscapes
        Currently active set of output escape code definitions (whether and how to escape or not) for 7-bit ASCII range (first 128 character codes). Defined separately to make potentially customizable
      • _maximumNonEscapedChar

        protected int _maximumNonEscapedChar
        Value between 128 (0x80) and 65535 (0xFFFF) that indicates highest Unicode code point that will not need escaping; or 0 to indicate that all characters can be represented without escaping. Typically used to force escaping of some portion of character set; for example to always escape non-ASCII characters (if value was 127).

        NOTE: not all sub-classes make use of this setting.

      • _characterEscapes

        protected CharacterEscapes _characterEscapes
        Definition of custom character escapes to use for generators created by this factory, if any. If null, standard data format specific escapes are used.
        Since:
        1.8
      • _outputBuffer

        protected byte[] _outputBuffer
        Intermediate buffer in which contents are buffered before being written using _outputStream.
      • _outputTail

        protected int _outputTail
        Pointer to the position right beyond the last character to output (end marker; may be past the buffer)
      • _outputEnd

        protected final int _outputEnd
        End marker of the output buffer; one past the last valid position within the buffer.
      • _outputMaxContiguous

        protected final int _outputMaxContiguous
        Maximum number of chars that we know will always fit in the output buffer after escaping
      • _charBuffer

        protected char[] _charBuffer
        Intermediate buffer in which characters of a String are copied before being encoded.
      • _charBufferLength

        protected final int _charBufferLength
        Length of _charBuffer
      • _entityBuffer

        protected byte[] _entityBuffer
        6 character temporary buffer allocated if needed, for constructing escape sequences
      • _bufferRecyclable

        protected boolean _bufferRecyclable
        Flag that indicates whether the output buffer is recycable (and needs to be returned to recycler once we are done) or not.