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
FieldsModifier and TypeFieldDescriptionprotected booleanFlag that indicates whether the output buffer is recyclable (and needs to be returned to recycler once we are done) or not.protected intLet's keep track of how many bytes have been output, may prove useful when debugging.protected final booleanprotected final booleanprotected char[]Intermediate buffer in which characters of a String are copied before being encoded.protected final intprotected intNumber of elements remaining in the current complex structure (if any), when writing defined-length Arrays, Objects; marker {code INDEFINITE_LENGTH} otherwise.protected int[]protected intprotected final intBit flag composed of bits that indicate whichCBORWriteFeatures are enabled.protected final OutputStreamprotected byte[]Intermediate buffer in which contents are buffered before being written using_out.protected final intOffset to index after the last valid index in_outputBuffer.protected intPointer to the next available byte in_outputBufferprotected CBORWriteContextTable of previously referenced text and binary strings when the STRINGREF feature is used.private static final BigIntegerprotected static final intLet's ensure that we have big enough output buffer because of safety margins we need for UTF-8 encoding.private static final intSpecial value that is use to keep tracks of arrays and maps opened with infinite lengthprivate static final intThis is the worst case length (in bytes) of maximum chunk we ever write.private static final intLongest 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 intprivate static final intprivate static final intprivate static final intprivate static final intTo 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 intThe 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
ConstructorsConstructorDescriptionCBORGenerator(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 TypeMethodDescriptionprivate int_appendReplacementChar(byte[] outBuf, int outputPtr) protected voidprivate 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 intprivate final intprivate final void_ensureRoomForOutput(int needed) protected final void_ensureSpace(int needed) private voidprotected final voidprivate int_invalidSurrogateEnd(int surr1, int surr2, byte[] outBuf, int outputPtr) private int_invalidSurrogateStart(int code, byte[] outBuf, int outputPtr) protected UnsupportedOperationExceptionprivate final voidprotected voidprivate 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_verifyValueWrite(String typeMsg) protected void_write(BigInteger v) 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_writeDoubleMinimal(double d) private final void_writeDoubleNoCheck(double d) private final void_writeFloatNoCheck(float f) private final void_writeIntFull(int markerBase, int i) private final void_writeIntMinimal(int markerBase, int i) private final void_writeIntValue(int i) private final void_writeLengthMarker(int majorType, int i) private final void_writeLongNoCheck(long l) private final void_writeLongValue(long l) protected final int_writeString(char[] text, int offset, int len) protected final void_writeString(String name) voidprivate final voidfinal voidflush()tools.jackson.core.PrettyPrinterfinal booleantools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamWriteCapability> tools.jackson.core.TokenStreamContextinttools.jackson.core.Versionversion()tools.jackson.core.JsonGeneratorwriteArray(double[] array, int offset, int length) tools.jackson.core.JsonGeneratorwriteArray(int[] array, int offset, int length) tools.jackson.core.JsonGeneratorwriteArray(long[] array, int offset, int length) intwriteBinary(InputStream data, int dataLength) tools.jackson.core.JsonGeneratorwriteBinary(tools.jackson.core.Base64Variant b64variant, byte[] data, int offset, int len) intwriteBinary(tools.jackson.core.Base64Variant b64variant, InputStream data, int dataLength) tools.jackson.core.JsonGeneratorwriteBoolean(boolean state) tools.jackson.core.JsonGeneratorwriteBytes(byte[] data, int offset, int len) Method for directly inserting specified bytes in output at current position.tools.jackson.core.JsonGeneratortools.jackson.core.JsonGeneratortools.jackson.core.JsonGeneratortools.jackson.core.JsonGeneratorwriteName(tools.jackson.core.SerializableString name) tools.jackson.core.JsonGeneratortools.jackson.core.JsonGeneratorwriteNumber(double d) tools.jackson.core.JsonGeneratorwriteNumber(float f) tools.jackson.core.JsonGeneratorwriteNumber(int i) tools.jackson.core.JsonGeneratorwriteNumber(long l) tools.jackson.core.JsonGeneratorwriteNumber(short v) tools.jackson.core.JsonGeneratorwriteNumber(String encodedValue) tools.jackson.core.JsonGeneratorwriteNumber(BigDecimal dec) tools.jackson.core.JsonGeneratorvoidwriteNumberUnsigned(int i) Method for outputting given value as an unsigned integer.voidwriteNumberUnsigned(long l) Method for outputting given value as an unsigned integer.tools.jackson.core.JsonGeneratorwritePropertyId(long id) tools.jackson.core.JsonGeneratorwriteRaw(byte b) Method for directly inserting specified byte in output at current position.tools.jackson.core.JsonGeneratorwriteRaw(char c) tools.jackson.core.JsonGeneratorwriteRaw(char[] text, int offset, int len) tools.jackson.core.JsonGeneratortools.jackson.core.JsonGeneratortools.jackson.core.JsonGeneratorwriteRawUTF8String(byte[] raw, int offset, int len) tools.jackson.core.JsonGeneratorwriteRawValue(char[] text, int offset, int len) tools.jackson.core.JsonGeneratorwriteRawValue(String text) tools.jackson.core.JsonGeneratorwriteRawValue(String text, int offset, int len) tools.jackson.core.JsonGeneratortools.jackson.core.JsonGeneratorwriteStartArray(Object currValue) tools.jackson.core.JsonGeneratorwriteStartArray(Object forValue, int elementsToWrite) tools.jackson.core.JsonGeneratortools.jackson.core.JsonGeneratorwriteStartObject(Object forValue) tools.jackson.core.JsonGeneratorwriteStartObject(Object forValue, int elementsToWrite) tools.jackson.core.JsonGeneratorwriteString(char[] text, int offset, int len) tools.jackson.core.JsonGeneratorwriteString(String text) tools.jackson.core.JsonGeneratorwriteString(tools.jackson.core.SerializableString sstr) tools.jackson.core.JsonGeneratorwriteTag(int tagId) Method for writing out an explicit CBOR Tag.tools.jackson.core.JsonGeneratorwriteUTF8String(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, writeTreeMethods 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
-
Field Details
-
NO_INTS
private static final int[] NO_INTS -
BI_MINUS_ONE
-
BYTE_BUFFER_FOR_OUTPUT
protected static final int BYTE_BUFFER_FOR_OUTPUTLet'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_CHARThe 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_CHARSLongest 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_BYTESThis is the worst case length (in bytes) of maximum chunk we ever write.- See Also:
-
MIN_BUFFER_LENGTH
private static final int MIN_BUFFER_LENGTHTo 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_LENGTHSpecial value that is use to keep tracks of arrays and maps opened with infinite length- See Also:
-
_out
-
_formatFeatures
protected final int _formatFeaturesBit flag composed of bits that indicate whichCBORWriteFeatures are enabled. -
_cfgMinimalInts
protected final boolean _cfgMinimalInts -
_cfgMinimalDoubles
protected final boolean _cfgMinimalDoubles -
_streamWriteContext
-
_outputBuffer
protected byte[] _outputBufferIntermediate buffer in which contents are buffered before being written using_out. -
_outputTail
protected int _outputTailPointer to the next available byte in_outputBuffer -
_outputEnd
protected final int _outputEndOffset to index after the last valid index in_outputBuffer. Typically same as length of the buffer. -
_charBuffer
protected char[] _charBufferIntermediate buffer in which characters of a String are copied before being encoded. -
_charBufferLength
protected final int _charBufferLength -
_bytesWritten
protected int _bytesWrittenLet'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 _currentRemainingElementsNumber of elements remaining in the current complex structure (if any), when writing defined-length Arrays, Objects; marker {code INDEFINITE_LENGTH} otherwise. -
_bufferRecyclable
protected boolean _bufferRecyclableFlag that indicates whether the output buffer is recyclable (and needs to be returned to recycler once we are done) or not. -
_stringRefs
-
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 streamoffset- 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:
versionin interfacetools.jackson.core.Versioned- Specified by:
versionin classtools.jackson.core.JsonGenerator
-
streamWriteCapabilities
public tools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamWriteCapability> streamWriteCapabilities()- Specified by:
streamWriteCapabilitiesin classtools.jackson.core.JsonGenerator
-
streamWriteOutputTarget
- Specified by:
streamWriteOutputTargetin classtools.jackson.core.JsonGenerator
-
streamWriteOutputBuffered
public int streamWriteOutputBuffered()- Specified by:
streamWriteOutputBufferedin classtools.jackson.core.JsonGenerator
-
getPrettyPrinter
public tools.jackson.core.PrettyPrinter getPrettyPrinter()- Overrides:
getPrettyPrinterin classtools.jackson.core.JsonGenerator
-
currentValue
- Specified by:
currentValuein classtools.jackson.core.JsonGenerator
-
assignCurrentValue
- Specified by:
assignCurrentValuein classtools.jackson.core.JsonGenerator
-
streamWriteContext
public tools.jackson.core.TokenStreamContext streamWriteContext()- Specified by:
streamWriteContextin classtools.jackson.core.JsonGenerator
-
isEnabled
-
writeName
public tools.jackson.core.JsonGenerator writeName(String name) throws tools.jackson.core.JacksonException - Specified by:
writeNamein classtools.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:
writeNamein classtools.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:
writePropertyIdin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeStartArray
public tools.jackson.core.JsonGenerator writeStartArray() throws tools.jackson.core.JacksonException- Specified by:
writeStartArrayin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeStartArray
public tools.jackson.core.JsonGenerator writeStartArray(Object currValue) throws tools.jackson.core.JacksonException - Specified by:
writeStartArrayin classtools.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:
writeStartArrayin classtools.jackson.core.base.GeneratorBase- Throws:
tools.jackson.core.JacksonException
-
writeEndArray
public tools.jackson.core.JsonGenerator writeEndArray() throws tools.jackson.core.JacksonException- Specified by:
writeEndArrayin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeStartObject
public tools.jackson.core.JsonGenerator writeStartObject() throws tools.jackson.core.JacksonException- Specified by:
writeStartObjectin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeStartObject
public tools.jackson.core.JsonGenerator writeStartObject(Object forValue) throws tools.jackson.core.JacksonException - Specified by:
writeStartObjectin classtools.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:
writeStartObjectin classtools.jackson.core.base.GeneratorBase- Throws:
tools.jackson.core.JacksonException
-
writeEndObject
public tools.jackson.core.JsonGenerator writeEndObject() throws tools.jackson.core.JacksonException- Specified by:
writeEndObjectin classtools.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:
writeArrayin classtools.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:
writeArrayin classtools.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:
writeArrayin classtools.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:
writeStringin classtools.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:
writeStringin classtools.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:
writeStringin classtools.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:
writeRawUTF8Stringin classtools.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:
writeUTF8Stringin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeRaw
public tools.jackson.core.JsonGenerator writeRaw(String text) throws tools.jackson.core.JacksonException - Specified by:
writeRawin classtools.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:
writeRawin classtools.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:
writeRawin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeRaw
public tools.jackson.core.JsonGenerator writeRaw(char c) throws tools.jackson.core.JacksonException - Specified by:
writeRawin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeRawValue
public tools.jackson.core.JsonGenerator writeRawValue(String text) throws tools.jackson.core.JacksonException - Overrides:
writeRawValuein classtools.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:
writeRawValuein classtools.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:
writeRawValuein classtools.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:
writeBinaryin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeBinary
- Overrides:
writeBinaryin classtools.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:
writeBinaryin classtools.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:
writeBooleanin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeNull
public tools.jackson.core.JsonGenerator writeNull() throws tools.jackson.core.JacksonException- Specified by:
writeNullin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeNumberUnsigned
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:
writeNumberin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeNumber
public tools.jackson.core.JsonGenerator writeNumber(int i) throws tools.jackson.core.JacksonException - Specified by:
writeNumberin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeNumberUnsigned
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:
writeNumberin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeNumber
public tools.jackson.core.JsonGenerator writeNumber(BigInteger v) throws tools.jackson.core.JacksonException - Specified by:
writeNumberin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
_write
- Throws:
tools.jackson.core.JacksonException
-
writeNumber
public tools.jackson.core.JsonGenerator writeNumber(double d) throws tools.jackson.core.JacksonException - Specified by:
writeNumberin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeNumber
public tools.jackson.core.JsonGenerator writeNumber(float f) throws tools.jackson.core.JacksonException - Specified by:
writeNumberin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeNumber
public tools.jackson.core.JsonGenerator writeNumber(BigDecimal dec) throws tools.jackson.core.JacksonException - Specified by:
writeNumberin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeNumber
public tools.jackson.core.JsonGenerator writeNumber(String encodedValue) throws tools.jackson.core.JacksonException - Specified by:
writeNumberin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
_verifyValueWrite
- Specified by:
_verifyValueWritein classtools.jackson.core.base.GeneratorBase- Throws:
tools.jackson.core.JacksonException
-
_failSizedArrayOrObject
private void _failSizedArrayOrObject() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
flush
-
_closeInput
- Specified by:
_closeInputin classtools.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
- 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:
_releaseBuffersin classtools.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
-