Class CBORGenerator
java.lang.Object
com.fasterxml.jackson.core.JsonGenerator
com.fasterxml.jackson.core.base.GeneratorBase
com.fasterxml.jackson.dataformat.cbor.CBORGenerator
- All Implemented Interfaces:
com.fasterxml.jackson.core.Versioned, Closeable, Flushable, AutoCloseable
public class CBORGenerator
extends com.fasterxml.jackson.core.base.GeneratorBase
JsonGenerator implementation that writes CBOR encoded content.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration that defines all togglable features for CBOR generator. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanFlag that indicates whether the output buffer is recycable (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 booleanprotected 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 intBit flag composed of bits that indicate whichCBORGenerator.Features 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 final com.fasterxml.jackson.core.StreamWriteConstraintsprotected CBORWriteContextTable of previously referenced text and binary strings when the STRINGREF feature is used.protected 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 com.fasterxml.jackson.core.base.GeneratorBase
_cfgNumbersAsStrings, _closed, _features, _ioContext, _objectCodec, _writeContext, DERIVED_FEATURES_MASK, MAX_BIG_DECIMAL_SCALE, SURR1_FIRST, SURR1_LAST, SURR2_FIRST, SURR2_LAST, WRITE_BINARY, WRITE_BOOLEAN, WRITE_NULL, WRITE_NUMBER, WRITE_RAW, WRITE_STRINGFields inherited from class com.fasterxml.jackson.core.JsonGenerator
_cfgPrettyPrinter, DEFAULT_BINARY_WRITE_CAPABILITIES, DEFAULT_TEXTUAL_WRITE_CAPABILITIES, DEFAULT_WRITE_CAPABILITIES -
Constructor Summary
ConstructorsConstructorDescriptionCBORGenerator(com.fasterxml.jackson.core.io.IOContext ioCtxt, int stdFeatures, int formatFeatures, com.fasterxml.jackson.core.ObjectCodec codec, OutputStream out) CBORGenerator(com.fasterxml.jackson.core.io.IOContext ioCtxt, int stdFeatures, int formatFeatures, com.fasterxml.jackson.core.ObjectCodec codec, 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) 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 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) voidbooleanvoidclose()private final voidconfigure(CBORGenerator.Feature f, boolean state) final voidflush()Deprecated.intintcom.fasterxml.jackson.core.JsonStreamContextcom.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamWriteCapability> final booleancom.fasterxml.jackson.core.JsonGeneratoroverrideFormatFeatures(int values, int mask) com.fasterxml.jackson.core.JsonGeneratoroverrideStdFeatures(int values, int mask) voidDeprecated.com.fasterxml.jackson.core.JsonGeneratorsetPrettyPrinter(com.fasterxml.jackson.core.PrettyPrinter pp) No way (or need) to indent anything, so let's block any attempts.com.fasterxml.jackson.core.StreamWriteConstraintscom.fasterxml.jackson.core.JsonGeneratorNo way (or need) to indent anything, so let's block any attempts.com.fasterxml.jackson.core.Versionversion()voidwriteArray(double[] array, int offset, int length) voidwriteArray(int[] array, int offset, int length) voidwriteArray(long[] array, int offset, int length) voidwriteBinary(com.fasterxml.jackson.core.Base64Variant b64variant, byte[] data, int offset, int len) intwriteBinary(com.fasterxml.jackson.core.Base64Variant b64variant, InputStream data, int dataLength) intwriteBinary(InputStream data, int dataLength) voidwriteBoolean(boolean state) voidwriteBytes(byte[] data, int offset, int len) Method for directly inserting specified bytes in output at current position.final voidfinal voidfinal voidwriteFieldId(long id) final voidwriteFieldName(com.fasterxml.jackson.core.SerializableString name) final voidwriteFieldName(String name) voidvoidwriteNumber(double d) voidwriteNumber(float f) voidwriteNumber(int i) voidwriteNumber(long l) voidwriteNumber(String encodedValue) voidwriteNumber(BigDecimal dec) voidvoidwriteRaw(byte b) Method for directly inserting specified byte in output at current position.voidwriteRaw(char c) voidwriteRaw(char[] text, int offset, int len) voidvoidvoidwriteRawUTF8String(byte[] raw, int offset, int len) voidwriteRawValue(char[] text, int offset, int len) voidwriteRawValue(String text) voidwriteRawValue(String text, int offset, int len) final voidvoidwriteStartArray(int elementsToWrite) Deprecated.voidwriteStartArray(Object forValue) voidwriteStartArray(Object forValue, int elementsToWrite) final voidfinal voidwriteStartObject(int elementsToWrite) final voidwriteStartObject(Object forValue) voidwriteStartObject(Object forValue, int elementsToWrite) voidwriteString(char[] text, int offset, int len) final voidwriteString(com.fasterxml.jackson.core.SerializableString sstr) voidwriteString(String text) voidwriteTag(int tagId) Method for writing out an explicit CBOR Tag.final voidwriteUTF8String(byte[] text, int offset, int len) Methods inherited from class com.fasterxml.jackson.core.base.GeneratorBase
_asString, _checkRangeBoundsForByteArray, _checkRangeBoundsForCharArray, _checkRangeBoundsForString, _checkStdFeatureChanges, _constructDefaultPrettyPrinter, _decodeSurrogate, disable, enable, getCodec, getFeatureMask, ioContext, isClosed, isEnabled, setCodec, setFeatureMask, writeObject, writeRawValue, writeTreeMethods inherited from class com.fasterxml.jackson.core.JsonGenerator
_constructWriteException, _constructWriteException, _constructWriteException, _constructWriteException, _copyCurrentContents, _copyCurrentFloatValue, _copyCurrentFloatValueExact, _copyCurrentIntValue, _copyCurrentStringValue, _reportError, _reportUnsupportedOperation, _reportUnsupportedOperation, _throwInternal, _verifyOffsets, _writeSimpleObject, canOmitFields, canUseSchema, canWriteFormattedNumbers, canWriteObjectId, canWriteTypeId, configure, copyCurrentEvent, copyCurrentEventExact, copyCurrentStructure, getCharacterEscapes, getHighestEscapedChar, getPrettyPrinter, getSchema, isEnabled, setCharacterEscapes, setHighestNonEscapedChar, setRootValueSeparator, setSchema, writeArray, writeArrayFieldStart, writeBinary, writeBinary, writeBinaryField, writeBooleanField, writeEmbeddedObject, writeNullField, writeNumber, writeNumber, writeNumberField, writeNumberField, writeNumberField, writeNumberField, writeNumberField, writeNumberField, writeNumberField, writeObjectField, writeObjectFieldStart, writeObjectId, writeObjectRef, writeOmittedField, writePOJO, writePOJOField, writeRaw, writeString, writeStringField, writeTypeId, writeTypePrefix, writeTypeSuffix
-
Field Details
-
NO_INTS
private static final int[] NO_INTS -
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).- Since:
- 2.12
- 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:
-
_streamWriteConstraints
protected final com.fasterxml.jackson.core.StreamWriteConstraints _streamWriteConstraints- Since:
- 2.16
-
_out
-
_formatFeatures
protected int _formatFeaturesBit flag composed of bits that indicate whichCBORGenerator.Features are enabled. -
_cfgMinimalInts
protected boolean _cfgMinimalInts -
_cfgMinimalDoubles
protected 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 recycable (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(com.fasterxml.jackson.core.io.IOContext ioCtxt, int stdFeatures, int formatFeatures, com.fasterxml.jackson.core.ObjectCodec codec, OutputStream out) -
CBORGenerator
public CBORGenerator(com.fasterxml.jackson.core.io.IOContext ioCtxt, int stdFeatures, int formatFeatures, com.fasterxml.jackson.core.ObjectCodec codec, 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 com.fasterxml.jackson.core.Version version()- Specified by:
versionin interfacecom.fasterxml.jackson.core.Versioned- Overrides:
versionin classcom.fasterxml.jackson.core.base.GeneratorBase
-
canWriteBinaryNatively
public boolean canWriteBinaryNatively()- Overrides:
canWriteBinaryNativelyin classcom.fasterxml.jackson.core.JsonGenerator
-
getWriteCapabilities
public com.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamWriteCapability> getWriteCapabilities()- Overrides:
getWriteCapabilitiesin classcom.fasterxml.jackson.core.JsonGenerator
-
streamWriteConstraints
public com.fasterxml.jackson.core.StreamWriteConstraints streamWriteConstraints()- Overrides:
streamWriteConstraintsin classcom.fasterxml.jackson.core.JsonGenerator
-
useDefaultPrettyPrinter
public com.fasterxml.jackson.core.JsonGenerator useDefaultPrettyPrinter()No way (or need) to indent anything, so let's block any attempts. (should we throw an exception instead?)- Overrides:
useDefaultPrettyPrinterin classcom.fasterxml.jackson.core.base.GeneratorBase
-
setPrettyPrinter
public com.fasterxml.jackson.core.JsonGenerator setPrettyPrinter(com.fasterxml.jackson.core.PrettyPrinter pp) No way (or need) to indent anything, so let's block any attempts. (should we throw an exception instead?)- Overrides:
setPrettyPrinterin classcom.fasterxml.jackson.core.JsonGenerator
-
getOutputTarget
- Overrides:
getOutputTargetin classcom.fasterxml.jackson.core.JsonGenerator
-
getOutputBuffered
public int getOutputBuffered()- Overrides:
getOutputBufferedin classcom.fasterxml.jackson.core.JsonGenerator
-
getFormatFeatures
public int getFormatFeatures()- Overrides:
getFormatFeaturesin classcom.fasterxml.jackson.core.JsonGenerator
-
overrideStdFeatures
public com.fasterxml.jackson.core.JsonGenerator overrideStdFeatures(int values, int mask) - Overrides:
overrideStdFeaturesin classcom.fasterxml.jackson.core.base.GeneratorBase
-
overrideFormatFeatures
public com.fasterxml.jackson.core.JsonGenerator overrideFormatFeatures(int values, int mask) - Overrides:
overrideFormatFeaturesin classcom.fasterxml.jackson.core.JsonGenerator
-
getOutputContext
public com.fasterxml.jackson.core.JsonStreamContext getOutputContext()- Overrides:
getOutputContextin classcom.fasterxml.jackson.core.base.GeneratorBase
-
currentValue
- Overrides:
currentValuein classcom.fasterxml.jackson.core.base.GeneratorBase
-
assignCurrentValue
- Overrides:
assignCurrentValuein classcom.fasterxml.jackson.core.base.GeneratorBase
-
getCurrentValue
Deprecated.- Overrides:
getCurrentValuein classcom.fasterxml.jackson.core.JsonGenerator
-
setCurrentValue
Deprecated.- Overrides:
setCurrentValuein classcom.fasterxml.jackson.core.JsonGenerator
-
enable
-
disable
-
isEnabled
-
configure
-
writeFieldName
- Specified by:
writeFieldNamein classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeFieldName
public final void writeFieldName(com.fasterxml.jackson.core.SerializableString name) throws IOException - Overrides:
writeFieldNamein classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
IOException
-
writeFieldId
- Overrides:
writeFieldIdin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeStartArray
- Specified by:
writeStartArrayin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeStartArray
- Overrides:
writeStartArrayin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeStartArray
- Overrides:
writeStartArrayin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeStartArray
Deprecated.- Overrides:
writeStartArrayin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeEndArray
- Specified by:
writeEndArrayin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeStartObject
- Specified by:
writeStartObjectin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeStartObject
- Overrides:
writeStartObjectin classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
IOException
-
writeStartObject
- Throws:
IOException
-
writeStartObject
- Overrides:
writeStartObjectin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeEndObject
- Specified by:
writeEndObjectin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeArray
- Overrides:
writeArrayin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeArray
- Overrides:
writeArrayin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeArray
- Overrides:
writeArrayin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
_pushRemainingElements
private final void _pushRemainingElements() -
_writeIntMinimal
- Throws:
IOException
-
_writeIntFull
- Throws:
IOException
-
_writeLongNoCheck
- Throws:
IOException
-
_writeFloatNoCheck
- Throws:
IOException
-
_writeDoubleNoCheck
- Throws:
IOException
-
_writeDoubleMinimal
- Throws:
IOException
-
writeString
- Specified by:
writeStringin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeString
public final void writeString(com.fasterxml.jackson.core.SerializableString sstr) throws IOException - Overrides:
writeStringin classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
IOException
-
writeString
- Specified by:
writeStringin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeRawUTF8String
- Specified by:
writeRawUTF8Stringin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeUTF8String
- Specified by:
writeUTF8Stringin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeRaw
- Specified by:
writeRawin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeRaw
- Specified by:
writeRawin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeRaw
- Specified by:
writeRawin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeRaw
- Specified by:
writeRawin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeRawValue
- Overrides:
writeRawValuein classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
IOException
-
writeRawValue
- Overrides:
writeRawValuein classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
IOException
-
writeRawValue
- Overrides:
writeRawValuein classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
IOException
-
writeBinary
public void writeBinary(com.fasterxml.jackson.core.Base64Variant b64variant, byte[] data, int offset, int len) throws IOException - Specified by:
writeBinaryin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeBinary
- Overrides:
writeBinaryin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeBinary
public int writeBinary(com.fasterxml.jackson.core.Base64Variant b64variant, InputStream data, int dataLength) throws IOException - Overrides:
writeBinaryin classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
IOException
-
writeBoolean
- Specified by:
writeBooleanin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeNull
- Specified by:
writeNullin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeNumber
- Specified by:
writeNumberin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeNumber
- Specified by:
writeNumberin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeNumber
- Specified by:
writeNumberin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
_write
- Throws:
IOException
-
writeNumber
- Specified by:
writeNumberin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeNumber
- Specified by:
writeNumberin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeNumber
- Specified by:
writeNumberin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOException
-
writeNumber
public void writeNumber(String encodedValue) throws IOException, com.fasterxml.jackson.core.JsonGenerationException, UnsupportedOperationException - Specified by:
writeNumberin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
IOExceptioncom.fasterxml.jackson.core.JsonGenerationExceptionUnsupportedOperationException
-
_verifyValueWrite
- Specified by:
_verifyValueWritein classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
IOException
-
_failSizedArrayOrObject
- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
IOException
-
writeTag
Method for writing out an explicit CBOR Tag.- Parameters:
tagId- Positive integer (0 or higher)- Throws:
IOException- Since:
- 2.5
-
writeRaw
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:
IOException
-
writeBytes
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:
IOException
-
_writeString
- Throws:
IOException
-
_ensureSpace
- Throws:
IOException
-
_writeString
- Throws:
IOException
-
_writeChunkedString
- Throws:
IOException
-
_encode
Helper method called when the whole character sequence is known to fit in the output buffer regardless of UTF-8 expansion.- Throws:
IOException
-
_shortUTF8Encode2
private final int _shortUTF8Encode2(char[] str, int i, int end, int outputPtr, int outputStart) throws IOException 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:
IOException
-
_encode
- Throws:
IOException
-
_encode2
private final int _encode2(int i, int outputPtr, String str, int len, int outputStart) throws IOException - Throws:
IOException
-
_invalidSurrogateStart
- Throws:
IOException
-
_invalidSurrogateEnd
private int _invalidSurrogateEnd(int surr1, int surr2, byte[] outBuf, int outputPtr) throws IOException - Throws:
IOException
-
_appendReplacementChar
private int _appendReplacementChar(byte[] outBuf, int outputPtr) -
_decodeAndWriteSurrogate
private int _decodeAndWriteSurrogate(int surr1, int surr2, byte[] outBuf, int outputPtr) -
_ensureRoomForOutput
- Throws:
IOException
-
_writeIntValue
- Throws:
IOException
-
_writeLongValue
- Throws:
IOException
-
_writeLengthMarker
- Throws:
IOException
-
_writeByte
- Throws:
IOException
-
_writeBytes
- Throws:
IOException
-
_writeBytes
- Throws:
IOException
-
_writeBytesLong
- Throws:
IOException
-
_releaseBuffers
protected void _releaseBuffers()- Specified by:
_releaseBuffersin classcom.fasterxml.jackson.core.base.GeneratorBase
-
_flushBuffer
- Throws:
IOException
-
closeComplexElement
- Throws:
IOException
-
_notSupported
-