Class CBORGenerator

java.lang.Object
tools.jackson.core.JsonGenerator
tools.jackson.core.base.GeneratorBase
tools.jackson.dataformat.cbor.CBORGenerator
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, tools.jackson.core.Versioned

public class CBORGenerator extends tools.jackson.core.base.GeneratorBase
JsonGenerator implementation that writes CBOR encoded content.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    Flag that indicates whether the output buffer is recyclable (and needs to be returned to recycler once we are done) or not.
    protected int
    Let's keep track of how many bytes have been output, may prove useful when debugging.
    protected final boolean
     
    protected final boolean
     
    protected char[]
    Intermediate buffer in which characters of a String are copied before being encoded.
    protected final int
     
    protected int
    Number of elements remaining in the current complex structure (if any), when writing defined-length Arrays, Objects; marker {code INDEFINITE_LENGTH} otherwise.
    protected int[]
     
    protected int
     
    protected final int
    Bit flag composed of bits that indicate which CBORWriteFeatures are enabled.
    protected final OutputStream
     
    protected byte[]
    Intermediate buffer in which contents are buffered before being written using _out.
    protected final int
    Offset to index after the last valid index in _outputBuffer.
    protected int
    Pointer to the next available byte in _outputBuffer
     
    Table of previously referenced text and binary strings when the STRINGREF feature is used.
    private static final BigInteger
     
    protected static final int
    Let's ensure that we have big enough output buffer because of safety margins we need for UTF-8 encoding.
    private static final int
    Special value that is use to keep tracks of arrays and maps opened with infinite length
    private static final int
    This is the worst case length (in bytes) of maximum chunk we ever write.
    private static final int
    Longest char chunk we will output is chosen so that it is guaranteed to fit in an empty buffer even if everything encoded in 3-byte sequences; but also fit two full chunks in case of single-byte (ascii) output.
    private static final int
     
    private static final int
     
    private static final int
     
    private static final int
     
    private static final int
    To simplify certain operations, we require output buffer length to allow outputting of contiguous 256 character UTF-8 encoded String value.
    private static final int[]
     
    protected static final int
    The replacement character to use to fix invalid Unicode sequences (mismatched surrogate pair).

    Fields inherited from class tools.jackson.core.base.GeneratorBase

    _closed, _ioContext, _objectWriteContext, _streamWriteConstraints, _streamWriteFeatures, DEFAULT_BINARY_WRITE_CAPABILITIES, DEFAULT_TEXTUAL_WRITE_CAPABILITIES, DEFAULT_WRITE_CAPABILITIES, MAX_BIG_DECIMAL_SCALE, SURR1_FIRST, SURR1_LAST, SURR2_FIRST, SURR2_LAST, WRITE_BINARY, WRITE_BOOLEAN, WRITE_NULL, WRITE_NUMBER, WRITE_RAW, WRITE_STRING
  • Constructor Summary

    Constructors
    Constructor
    Description
    CBORGenerator(tools.jackson.core.ObjectWriteContext writeCtxt, tools.jackson.core.io.IOContext ioCtxt, int streamWriteFeatures, int formatFeatures, OutputStream out)
     
    CBORGenerator(tools.jackson.core.ObjectWriteContext writeCtxt, tools.jackson.core.io.IOContext ioCtxt, int streamWriteFeatures, int formatFeatures, OutputStream out, byte[] outputBuffer, int offset, boolean bufferRecyclable)
    Alternative constructor that may be used to feed partially initialized content.
  • Method Summary

    Modifier and Type
    Method
    Description
    private int
    _appendReplacementChar(byte[] outBuf, int outputPtr)
     
    protected void
     
    private int
    _decodeAndWriteSurrogate(int surr1, int surr2, byte[] outBuf, int outputPtr)
     
    private final int
    _encode(int outputPtr, char[] str, int i, int end)
    Helper method called when the whole character sequence is known to fit in the output buffer regardless of UTF-8 expansion.
    private final int
    _encode(int outputPtr, String str, int len)
     
    private final int
    _encode2(int i, int outputPtr, String str, int len, int outputStart)
     
    private final void
     
    protected final void
    _ensureSpace(int needed)
     
    private void
     
    protected final void
     
    private int
    _invalidSurrogateEnd(int surr1, int surr2, byte[] outBuf, int outputPtr)
     
    private int
    _invalidSurrogateStart(int code, byte[] outBuf, int outputPtr)
     
     
    private final void
     
    protected void
     
    private final int
    _shortUTF8Encode2(char[] str, int i, int end, int outputPtr, int outputStart)
    Helper method called when the whole character sequence is known to fit in the output buffer, but not all characters are single-byte (ASCII) characters.
    protected final void
     
    protected void
     
    private final void
    _writeByte(byte b)
     
    private final void
    _writeBytes(byte[] data, int offset, int len)
     
    private final int
    _writeBytes(InputStream in, int bytesLeft)
     
    private final void
    _writeBytesLong(byte[] data, int offset, int len)
     
    protected final void
    _writeChunkedString(char[] text, int offset, int len)
     
    private final void
     
    private final void
     
    private final void
     
    private final void
    _writeIntFull(int markerBase, int i)
     
    private final void
    _writeIntMinimal(int markerBase, int i)
     
    private final void
     
    private final void
    _writeLengthMarker(int majorType, int i)
     
    private final void
     
    private final void
     
    protected final int
    _writeString(char[] text, int offset, int len)
     
    protected final void
     
    void
     
    private final void
     
     
    final void
     
    tools.jackson.core.PrettyPrinter
     
    final boolean
     
    tools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamWriteCapability>
     
    tools.jackson.core.TokenStreamContext
     
    int
     
     
    tools.jackson.core.Version
     
    tools.jackson.core.JsonGenerator
    writeArray(double[] array, int offset, int length)
     
    tools.jackson.core.JsonGenerator
    writeArray(int[] array, int offset, int length)
     
    tools.jackson.core.JsonGenerator
    writeArray(long[] array, int offset, int length)
     
    int
    writeBinary(InputStream data, int dataLength)
     
    tools.jackson.core.JsonGenerator
    writeBinary(tools.jackson.core.Base64Variant b64variant, byte[] data, int offset, int len)
     
    int
    writeBinary(tools.jackson.core.Base64Variant b64variant, InputStream data, int dataLength)
     
    tools.jackson.core.JsonGenerator
    writeBoolean(boolean state)
     
    tools.jackson.core.JsonGenerator
    writeBytes(byte[] data, int offset, int len)
    Method for directly inserting specified bytes in output at current position.
    tools.jackson.core.JsonGenerator
     
    tools.jackson.core.JsonGenerator
     
    tools.jackson.core.JsonGenerator
     
    tools.jackson.core.JsonGenerator
    writeName(tools.jackson.core.SerializableString name)
     
    tools.jackson.core.JsonGenerator
     
    tools.jackson.core.JsonGenerator
    writeNumber(double d)
     
    tools.jackson.core.JsonGenerator
    writeNumber(float f)
     
    tools.jackson.core.JsonGenerator
    writeNumber(int i)
     
    tools.jackson.core.JsonGenerator
    writeNumber(long l)
     
    tools.jackson.core.JsonGenerator
    writeNumber(short v)
     
    tools.jackson.core.JsonGenerator
    writeNumber(String encodedValue)
     
    tools.jackson.core.JsonGenerator
     
    tools.jackson.core.JsonGenerator
     
    void
    Method for outputting given value as an unsigned integer.
    void
    Method for outputting given value as an unsigned integer.
    tools.jackson.core.JsonGenerator
    writePropertyId(long id)
     
    tools.jackson.core.JsonGenerator
    writeRaw(byte b)
    Method for directly inserting specified byte in output at current position.
    tools.jackson.core.JsonGenerator
    writeRaw(char c)
     
    tools.jackson.core.JsonGenerator
    writeRaw(char[] text, int offset, int len)
     
    tools.jackson.core.JsonGenerator
     
    tools.jackson.core.JsonGenerator
    writeRaw(String text, int offset, int len)
     
    tools.jackson.core.JsonGenerator
    writeRawUTF8String(byte[] raw, int offset, int len)
     
    tools.jackson.core.JsonGenerator
    writeRawValue(char[] text, int offset, int len)
     
    tools.jackson.core.JsonGenerator
     
    tools.jackson.core.JsonGenerator
    writeRawValue(String text, int offset, int len)
     
    tools.jackson.core.JsonGenerator
     
    tools.jackson.core.JsonGenerator
     
    tools.jackson.core.JsonGenerator
    writeStartArray(Object forValue, int elementsToWrite)
     
    tools.jackson.core.JsonGenerator
     
    tools.jackson.core.JsonGenerator
     
    tools.jackson.core.JsonGenerator
    writeStartObject(Object forValue, int elementsToWrite)
     
    tools.jackson.core.JsonGenerator
    writeString(char[] text, int offset, int len)
     
    tools.jackson.core.JsonGenerator
     
    tools.jackson.core.JsonGenerator
    writeString(tools.jackson.core.SerializableString sstr)
     
    tools.jackson.core.JsonGenerator
    writeTag(int tagId)
    Method for writing out an explicit CBOR Tag.
    tools.jackson.core.JsonGenerator
    writeUTF8String(byte[] text, int offset, int len)
     

    Methods inherited from class tools.jackson.core.base.GeneratorBase

    _asString, _checkRangeBoundsForByteArray, _checkRangeBoundsForCharArray, _checkRangeBoundsForString, _constructDefaultPrettyPrinter, _decodeSurrogate, _throwInternal, close, configure, has, ioContext, isClosed, isEnabled, objectWriteContext, streamWriteConstraints, streamWriteFeatures, writePOJO, writeRawValue, writeString, writeTree

    Methods inherited from class tools.jackson.core.JsonGenerator

    _constructWriteException, _constructWriteException, _constructWriteException, _constructWriteException, _copyCurrentContents, _copyCurrentContentsExact, _copyCurrentFloatValue, _copyCurrentFloatValueExact, _copyCurrentIntValue, _copyCurrentStringValue, _reportArgumentError, _reportError, _reportUnsupportedOperation, _reportUnsupportedOperation, _verifyOffsets, _wrapIOFailure, _writeTypePrefixUsingNative, _writeTypePrefixUsingWrapper, canOmitProperties, canWriteObjectId, canWriteTypeId, copyCurrentEvent, copyCurrentEventExact, copyCurrentStructure, copyCurrentStructureExact, getCharacterEscapes, getHighestNonEscapedChar, getSchema, setCharacterEscapes, writeArray, writeArrayPropertyStart, writeBinary, writeBinary, writeBinaryProperty, writeBooleanProperty, writeEmbeddedObject, writeNullProperty, writeNumber, writeNumberProperty, writeNumberProperty, writeNumberProperty, writeNumberProperty, writeNumberProperty, writeNumberProperty, writeNumberProperty, writeObjectId, writeObjectPropertyStart, writeObjectRef, writeOmittedProperty, writePOJOProperty, writeRaw, writeStringProperty, writeTypeId, writeTypePrefix, writeTypeSuffix

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NO_INTS

      private static final int[] NO_INTS
    • BI_MINUS_ONE

      private static final BigInteger BI_MINUS_ONE
    • BYTE_BUFFER_FOR_OUTPUT

      protected static final int BYTE_BUFFER_FOR_OUTPUT
      Let's ensure that we have big enough output buffer because of safety margins we need for UTF-8 encoding.
      See Also:
    • REPLACEMENT_CHAR

      protected static final int REPLACEMENT_CHAR
      The replacement character to use to fix invalid Unicode sequences (mismatched surrogate pair).
      See Also:
    • MAX_LONG_STRING_CHARS

      private static final int MAX_LONG_STRING_CHARS
      Longest char chunk we will output is chosen so that it is guaranteed to fit in an empty buffer even if everything encoded in 3-byte sequences; but also fit two full chunks in case of single-byte (ascii) output.
      See Also:
    • MAX_LONG_STRING_BYTES

      private static final int MAX_LONG_STRING_BYTES
      This is the worst case length (in bytes) of maximum chunk we ever write.
      See Also:
    • MIN_BUFFER_LENGTH

      private static final int MIN_BUFFER_LENGTH
      To simplify certain operations, we require output buffer length to allow outputting of contiguous 256 character UTF-8 encoded String value. Length of the longest UTF-8 code point (from Java char) is 3 bytes, and we need both initial token byte and single-byte end marker so we get following value.

      Note: actually we could live with shorter one; absolute minimum would be for encoding 64-character Strings.

      See Also:
    • INDEFINITE_LENGTH

      private static final int INDEFINITE_LENGTH
      Special value that is use to keep tracks of arrays and maps opened with infinite length
      See Also:
    • _out

      protected final OutputStream _out
    • _formatFeatures

      protected final int _formatFeatures
      Bit flag composed of bits that indicate which CBORWriteFeatures are enabled.
    • _cfgMinimalInts

      protected final boolean _cfgMinimalInts
    • _cfgMinimalDoubles

      protected final boolean _cfgMinimalDoubles
    • _streamWriteContext

      protected CBORWriteContext _streamWriteContext
    • _outputBuffer

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

      protected int _outputTail
      Pointer to the next available byte in _outputBuffer
    • _outputEnd

      protected final int _outputEnd
      Offset to index after the last valid index in _outputBuffer. Typically same as length of the buffer.
    • _charBuffer

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

      protected final int _charBufferLength
    • _bytesWritten

      protected int _bytesWritten
      Let's keep track of how many bytes have been output, may prove useful when debugging. This does not include bytes buffered in the output buffer, just bytes that have been written using underlying stream writer.
    • _elementCounts

      protected int[] _elementCounts
    • _elementCountsPtr

      protected int _elementCountsPtr
    • _currentRemainingElements

      protected int _currentRemainingElements
      Number of elements remaining in the current complex structure (if any), when writing defined-length Arrays, Objects; marker {code INDEFINITE_LENGTH} otherwise.
    • _bufferRecyclable

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

      protected HashMap<Object,Integer> _stringRefs
      Table of previously referenced text and binary strings when the STRINGREF feature is used.
    • MAX_SHORT_STRING_CHARS

      private static final int MAX_SHORT_STRING_CHARS
      See Also:
    • MAX_SHORT_STRING_BYTES

      private static final int MAX_SHORT_STRING_BYTES
      See Also:
    • MAX_MEDIUM_STRING_CHARS

      private static final int MAX_MEDIUM_STRING_CHARS
      See Also:
    • MAX_MEDIUM_STRING_BYTES

      private static final int MAX_MEDIUM_STRING_BYTES
      See Also:
  • Constructor Details

    • CBORGenerator

      public CBORGenerator(tools.jackson.core.ObjectWriteContext writeCtxt, tools.jackson.core.io.IOContext ioCtxt, int streamWriteFeatures, int formatFeatures, OutputStream out)
    • CBORGenerator

      public CBORGenerator(tools.jackson.core.ObjectWriteContext writeCtxt, tools.jackson.core.io.IOContext ioCtxt, int streamWriteFeatures, int formatFeatures, OutputStream out, byte[] outputBuffer, int offset, boolean bufferRecyclable)
      Alternative constructor that may be used to feed partially initialized content.
      Parameters:
      outputBuffer - Buffer to use for output before flushing to the underlying stream
      offset - Offset pointing past already buffered content; that is, number of bytes of valid content to output, within buffer.
  • Method Details

    • version

      public tools.jackson.core.Version version()
      Specified by:
      version in interface tools.jackson.core.Versioned
      Specified by:
      version in class tools.jackson.core.JsonGenerator
    • streamWriteCapabilities

      public tools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamWriteCapability> streamWriteCapabilities()
      Specified by:
      streamWriteCapabilities in class tools.jackson.core.JsonGenerator
    • streamWriteOutputTarget

      public Object streamWriteOutputTarget()
      Specified by:
      streamWriteOutputTarget in class tools.jackson.core.JsonGenerator
    • streamWriteOutputBuffered

      public int streamWriteOutputBuffered()
      Specified by:
      streamWriteOutputBuffered in class tools.jackson.core.JsonGenerator
    • getPrettyPrinter

      public tools.jackson.core.PrettyPrinter getPrettyPrinter()
      Overrides:
      getPrettyPrinter in class tools.jackson.core.JsonGenerator
    • currentValue

      public Object currentValue()
      Specified by:
      currentValue in class tools.jackson.core.JsonGenerator
    • assignCurrentValue

      public void assignCurrentValue(Object v)
      Specified by:
      assignCurrentValue in class tools.jackson.core.JsonGenerator
    • streamWriteContext

      public tools.jackson.core.TokenStreamContext streamWriteContext()
      Specified by:
      streamWriteContext in class tools.jackson.core.JsonGenerator
    • isEnabled

      public final boolean isEnabled(CBORWriteFeature f)
    • writeName

      public tools.jackson.core.JsonGenerator writeName(String name) throws tools.jackson.core.JacksonException
      Specified by:
      writeName in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeName

      public tools.jackson.core.JsonGenerator writeName(tools.jackson.core.SerializableString name) throws tools.jackson.core.JacksonException
      Overrides:
      writeName in class tools.jackson.core.base.GeneratorBase
      Throws:
      tools.jackson.core.JacksonException
    • writePropertyId

      public tools.jackson.core.JsonGenerator writePropertyId(long id) throws tools.jackson.core.JacksonException
      Specified by:
      writePropertyId in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeStartArray

      public tools.jackson.core.JsonGenerator writeStartArray() throws tools.jackson.core.JacksonException
      Specified by:
      writeStartArray in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeStartArray

      public tools.jackson.core.JsonGenerator writeStartArray(Object currValue) throws tools.jackson.core.JacksonException
      Specified by:
      writeStartArray in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeStartArray

      public tools.jackson.core.JsonGenerator writeStartArray(Object forValue, int elementsToWrite) throws tools.jackson.core.JacksonException
      Overrides:
      writeStartArray in class tools.jackson.core.base.GeneratorBase
      Throws:
      tools.jackson.core.JacksonException
    • writeEndArray

      public tools.jackson.core.JsonGenerator writeEndArray() throws tools.jackson.core.JacksonException
      Specified by:
      writeEndArray in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeStartObject

      public tools.jackson.core.JsonGenerator writeStartObject() throws tools.jackson.core.JacksonException
      Specified by:
      writeStartObject in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeStartObject

      public tools.jackson.core.JsonGenerator writeStartObject(Object forValue) throws tools.jackson.core.JacksonException
      Specified by:
      writeStartObject in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeStartObject

      public tools.jackson.core.JsonGenerator writeStartObject(Object forValue, int elementsToWrite) throws tools.jackson.core.JacksonException
      Overrides:
      writeStartObject in class tools.jackson.core.base.GeneratorBase
      Throws:
      tools.jackson.core.JacksonException
    • writeEndObject

      public tools.jackson.core.JsonGenerator writeEndObject() throws tools.jackson.core.JacksonException
      Specified by:
      writeEndObject in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeArray

      public tools.jackson.core.JsonGenerator writeArray(int[] array, int offset, int length) throws tools.jackson.core.JacksonException
      Overrides:
      writeArray in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeArray

      public tools.jackson.core.JsonGenerator writeArray(long[] array, int offset, int length) throws tools.jackson.core.JacksonException
      Overrides:
      writeArray in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeArray

      public tools.jackson.core.JsonGenerator writeArray(double[] array, int offset, int length) throws tools.jackson.core.JacksonException
      Overrides:
      writeArray in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • _pushRemainingElements

      private final void _pushRemainingElements()
    • _writeIntMinimal

      private final void _writeIntMinimal(int markerBase, int i) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _writeIntFull

      private final void _writeIntFull(int markerBase, int i) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _writeLongNoCheck

      private final void _writeLongNoCheck(long l) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _writeFloatNoCheck

      private final void _writeFloatNoCheck(float f) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _writeDoubleNoCheck

      private final void _writeDoubleNoCheck(double d) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _writeDoubleMinimal

      private final void _writeDoubleMinimal(double d) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • writeString

      public tools.jackson.core.JsonGenerator writeString(String text) throws tools.jackson.core.JacksonException
      Specified by:
      writeString in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeString

      public tools.jackson.core.JsonGenerator writeString(tools.jackson.core.SerializableString sstr) throws tools.jackson.core.JacksonException
      Overrides:
      writeString in class tools.jackson.core.base.GeneratorBase
      Throws:
      tools.jackson.core.JacksonException
    • writeString

      public tools.jackson.core.JsonGenerator writeString(char[] text, int offset, int len) throws tools.jackson.core.JacksonException
      Specified by:
      writeString in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeRawUTF8String

      public tools.jackson.core.JsonGenerator writeRawUTF8String(byte[] raw, int offset, int len) throws tools.jackson.core.JacksonException
      Specified by:
      writeRawUTF8String in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeUTF8String

      public tools.jackson.core.JsonGenerator writeUTF8String(byte[] text, int offset, int len) throws tools.jackson.core.JacksonException
      Specified by:
      writeUTF8String in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeRaw

      public tools.jackson.core.JsonGenerator writeRaw(String text) throws tools.jackson.core.JacksonException
      Specified by:
      writeRaw in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeRaw

      public tools.jackson.core.JsonGenerator writeRaw(String text, int offset, int len) throws tools.jackson.core.JacksonException
      Specified by:
      writeRaw in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeRaw

      public tools.jackson.core.JsonGenerator writeRaw(char[] text, int offset, int len) throws tools.jackson.core.JacksonException
      Specified by:
      writeRaw in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeRaw

      public tools.jackson.core.JsonGenerator writeRaw(char c) throws tools.jackson.core.JacksonException
      Specified by:
      writeRaw in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeRawValue

      public tools.jackson.core.JsonGenerator writeRawValue(String text) throws tools.jackson.core.JacksonException
      Overrides:
      writeRawValue in class tools.jackson.core.base.GeneratorBase
      Throws:
      tools.jackson.core.JacksonException
    • writeRawValue

      public tools.jackson.core.JsonGenerator writeRawValue(String text, int offset, int len) throws tools.jackson.core.JacksonException
      Overrides:
      writeRawValue in class tools.jackson.core.base.GeneratorBase
      Throws:
      tools.jackson.core.JacksonException
    • writeRawValue

      public tools.jackson.core.JsonGenerator writeRawValue(char[] text, int offset, int len) throws tools.jackson.core.JacksonException
      Overrides:
      writeRawValue in class tools.jackson.core.base.GeneratorBase
      Throws:
      tools.jackson.core.JacksonException
    • writeBinary

      public tools.jackson.core.JsonGenerator writeBinary(tools.jackson.core.Base64Variant b64variant, byte[] data, int offset, int len) throws tools.jackson.core.JacksonException
      Specified by:
      writeBinary in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeBinary

      public int writeBinary(InputStream data, int dataLength) throws tools.jackson.core.JacksonException
      Overrides:
      writeBinary in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeBinary

      public int writeBinary(tools.jackson.core.Base64Variant b64variant, InputStream data, int dataLength) throws tools.jackson.core.JacksonException
      Overrides:
      writeBinary in class tools.jackson.core.base.GeneratorBase
      Throws:
      tools.jackson.core.JacksonException
    • writeBoolean

      public tools.jackson.core.JsonGenerator writeBoolean(boolean state) throws tools.jackson.core.JacksonException
      Specified by:
      writeBoolean in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeNull

      public tools.jackson.core.JsonGenerator writeNull() throws tools.jackson.core.JacksonException
      Specified by:
      writeNull in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeNumberUnsigned

      public void writeNumberUnsigned(int i) throws IOException
      Method for outputting given value as an unsigned integer. Can be called in any context where a value is expected (Array value, Object field value, root-level value).
      Parameters:
      i - Number value to write
      Throws:
      IOException - if there is either an underlying I/O problem or encoding issue at format layer
      Since:
      2.20
    • writeNumber

      public tools.jackson.core.JsonGenerator writeNumber(short v) throws tools.jackson.core.JacksonException
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeNumber

      public tools.jackson.core.JsonGenerator writeNumber(int i) throws tools.jackson.core.JacksonException
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeNumberUnsigned

      public void writeNumberUnsigned(long l) throws IOException
      Method for outputting given value as an unsigned integer. Can be called in any context where a value is expected (Array value, Object field value, root-level value).
      Parameters:
      l - Number value to write
      Throws:
      IOException - if there is either an underlying I/O problem or encoding issue at format layer
      Since:
      2.20
    • writeNumber

      public tools.jackson.core.JsonGenerator writeNumber(long l) throws tools.jackson.core.JacksonException
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeNumber

      public tools.jackson.core.JsonGenerator writeNumber(BigInteger v) throws tools.jackson.core.JacksonException
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • _write

      protected void _write(BigInteger v) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • writeNumber

      public tools.jackson.core.JsonGenerator writeNumber(double d) throws tools.jackson.core.JacksonException
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeNumber

      public tools.jackson.core.JsonGenerator writeNumber(float f) throws tools.jackson.core.JacksonException
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeNumber

      public tools.jackson.core.JsonGenerator writeNumber(BigDecimal dec) throws tools.jackson.core.JacksonException
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeNumber

      public tools.jackson.core.JsonGenerator writeNumber(String encodedValue) throws tools.jackson.core.JacksonException
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • _verifyValueWrite

      protected final void _verifyValueWrite(String typeMsg) throws tools.jackson.core.JacksonException
      Specified by:
      _verifyValueWrite in class tools.jackson.core.base.GeneratorBase
      Throws:
      tools.jackson.core.JacksonException
    • _failSizedArrayOrObject

      private void _failSizedArrayOrObject() throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • flush

      public final void flush() throws tools.jackson.core.JacksonException
      Specified by:
      flush in interface Flushable
      Specified by:
      flush in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • _closeInput

      protected void _closeInput() throws IOException
      Specified by:
      _closeInput in class tools.jackson.core.base.GeneratorBase
      Throws:
      IOException
    • writeTag

      public tools.jackson.core.JsonGenerator writeTag(int tagId) throws tools.jackson.core.JacksonException
      Method for writing out an explicit CBOR Tag.
      Parameters:
      tagId - Positive integer (0 or higher)
      Throws:
      tools.jackson.core.JacksonException
    • writeRaw

      public tools.jackson.core.JsonGenerator writeRaw(byte b) throws tools.jackson.core.JacksonException
      Method for directly inserting specified byte in output at current position.

      NOTE: only use this method if you really know what you are doing.

      Throws:
      tools.jackson.core.JacksonException
    • writeBytes

      public tools.jackson.core.JsonGenerator writeBytes(byte[] data, int offset, int len) throws tools.jackson.core.JacksonException
      Method for directly inserting specified bytes in output at current position.

      NOTE: only use this method if you really know what you are doing.

      Throws:
      tools.jackson.core.JacksonException
    • _writeString

      protected final void _writeString(String name) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _ensureSpace

      protected final void _ensureSpace(int needed) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _writeString

      protected final int _writeString(char[] text, int offset, int len) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _writeChunkedString

      protected final void _writeChunkedString(char[] text, int offset, int len) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _encode

      private final int _encode(int outputPtr, char[] str, int i, int end) throws tools.jackson.core.JacksonException
      Helper method called when the whole character sequence is known to fit in the output buffer regardless of UTF-8 expansion.
      Throws:
      tools.jackson.core.JacksonException
    • _shortUTF8Encode2

      private final int _shortUTF8Encode2(char[] str, int i, int end, int outputPtr, int outputStart) throws tools.jackson.core.JacksonException
      Helper method called when the whole character sequence is known to fit in the output buffer, but not all characters are single-byte (ASCII) characters.
      Throws:
      tools.jackson.core.JacksonException
    • _encode

      private final int _encode(int outputPtr, String str, int len) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _encode2

      private final int _encode2(int i, int outputPtr, String str, int len, int outputStart) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _invalidSurrogateStart

      private int _invalidSurrogateStart(int code, byte[] outBuf, int outputPtr) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _invalidSurrogateEnd

      private int _invalidSurrogateEnd(int surr1, int surr2, byte[] outBuf, int outputPtr) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _appendReplacementChar

      private int _appendReplacementChar(byte[] outBuf, int outputPtr)
    • _decodeAndWriteSurrogate

      private int _decodeAndWriteSurrogate(int surr1, int surr2, byte[] outBuf, int outputPtr)
    • _ensureRoomForOutput

      private final void _ensureRoomForOutput(int needed) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _writeIntValue

      private final void _writeIntValue(int i) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _writeLongValue

      private final void _writeLongValue(long l) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _writeLengthMarker

      private final void _writeLengthMarker(int majorType, int i) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _writeByte

      private final void _writeByte(byte b) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _writeBytes

      private final void _writeBytes(byte[] data, int offset, int len) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _writeBytes

      private final int _writeBytes(InputStream in, int bytesLeft) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _writeBytesLong

      private final void _writeBytesLong(byte[] data, int offset, int len) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _releaseBuffers

      protected void _releaseBuffers()
      Specified by:
      _releaseBuffers in class tools.jackson.core.base.GeneratorBase
    • _flushBuffer

      protected final void _flushBuffer() throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • closeComplexElement

      private final void closeComplexElement() throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _notSupported

      protected UnsupportedOperationException _notSupported()