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,java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class CBORGenerator extends com.fasterxml.jackson.core.base.GeneratorBaseJsonGeneratorimplementation that writes CBOR encoded content.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCBORGenerator.FeatureEnumeration that defines all togglable features for CBOR generator.
-
Field Summary
Fields Modifier and Type Field Description protected boolean_bufferRecyclableFlag that indicates whether the output buffer is recycable (and needs to be returned to recycler once we are done) or not.protected int_bytesWrittenLet's keep track of how many bytes have been output, may prove useful when debugging.protected boolean_cfgMinimalIntsprotected char[]_charBufferIntermediate buffer in which characters of a String are copied before being encoded.protected int_charBufferLengthprotected int_currentRemainingElementsNumber of elements remaining in the current complex structure (if any), when writing defined-length Arrays, Objects; markerINDEFINITE_LENGTHotherwise.protected int[]_elementCountsprotected int_elementCountsPtrprotected int_formatFeaturesBit flag composed of bits that indicate whichCBORGenerator.Features are enabled.protected com.fasterxml.jackson.core.io.IOContext_ioContextprotected java.io.OutputStream_outprotected byte[]_outputBufferIntermediate buffer in which contents are buffered before being written using_out.protected int_outputEndOffset to index after the last valid index in_outputBuffer.protected int_outputTailPointer to the next available byte in_outputBuffer(package private) static intBYTE_BUFFER_FOR_OUTPUTLet's ensure that we have big enough output buffer because of safety margins we need for UTF-8 encoding.private static intINDEFINITE_LENGTHSpecial value that is use to keep tracks of arrays and maps opened with infinite lengthprivate static longMAX_INT_AS_LONGprivate static intMAX_LONG_STRING_BYTESThis is the worst case length (in bytes) of maximum chunk we ever write.private static intMAX_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.private static intMAX_MEDIUM_STRING_BYTESprivate static intMAX_MEDIUM_STRING_CHARSprivate static intMAX_SHORT_STRING_BYTESprivate static intMAX_SHORT_STRING_CHARSprivate static intMIN_BUFFER_LENGTHTo simplify certain operations, we require output buffer length to allow outputting of contiguous 256 character UTF-8 encoded String value.private static longMIN_INT_AS_LONGprivate static int[]NO_INTS-
Fields inherited from class com.fasterxml.jackson.core.base.GeneratorBase
_cfgNumbersAsStrings, _closed, _features, _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_STRING
-
-
Constructor Summary
Constructors Constructor Description CBORGenerator(com.fasterxml.jackson.core.io.IOContext ctxt, int stdFeatures, int formatFeatures, com.fasterxml.jackson.core.ObjectCodec codec, java.io.OutputStream out)CBORGenerator(com.fasterxml.jackson.core.io.IOContext ctxt, int stdFeatures, int formatFeatures, com.fasterxml.jackson.core.ObjectCodec codec, java.io.OutputStream out, byte[] outputBuffer, int offset, boolean bufferRecyclable)Alternative constructor that may be used to feed partially initialized content.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private int_convertSurrogate(int firstPart, int secondPart)Method called to calculate UTF codepoint, from a surrogate pair.private 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 int_encode(int outputPtr, java.lang.String str, int len)private int_encode2(int i, int outputPtr, java.lang.String str, int len, int outputStart)private void_ensureRoomForOutput(int needed)protected void_ensureSpace(int needed)private void_failSizedArrayOrObject()protected void_flushBuffer()protected java.lang.UnsupportedOperationException_notSupported()private void_pushRemainingElements()protected void_releaseBuffers()private 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.private void_throwIllegalSurrogate(int code)protected void_verifyValueWrite(java.lang.String typeMsg)protected void_write(java.math.BigInteger v)private void_writeByte(byte b)private void_writeBytes(byte[] data, int offset, int len)private int_writeBytes(java.io.InputStream in, int bytesLeft)private void_writeBytesLong(byte[] data, int offset, int len)protected void_writeChunkedString(char[] text, int offset, int len)private void_writeIntValue(int i)private void_writeLengthMarker(int majorType, int i)private void_writeLongValue(long l)private void_writeNumberNoCheck(double d)private void_writeNumberNoCheck(int i)private void_writeNumberNoCheck(long l)protected void_writeString(char[] text, int offset, int len)protected void_writeString(java.lang.String name)booleancanWriteBinaryNatively()voidclose()private voidcloseComplexElement()CBORGeneratorconfigure(CBORGenerator.Feature f, boolean state)voidcopyCurrentEvent(com.fasterxml.jackson.core.JsonParser p)SpecializeJsonGenerator.copyCurrentEvent(com.fasterxml.jackson.core.JsonParser)to handle tags.voidcopyCurrentStructure(com.fasterxml.jackson.core.JsonParser p)SpecializeJsonGenerator.copyCurrentStructure(com.fasterxml.jackson.core.JsonParser)to handle tags.CBORGeneratordisable(CBORGenerator.Feature f)CBORGeneratorenable(CBORGenerator.Feature f)voidflush()intgetFormatFeatures()intgetOutputBuffered()java.lang.ObjectgetOutputTarget()booleanisEnabled(CBORGenerator.Feature f)protected voidmaybeCopyTag(com.fasterxml.jackson.core.JsonParser p)com.fasterxml.jackson.core.JsonGeneratoroverrideFormatFeatures(int values, int mask)com.fasterxml.jackson.core.JsonGeneratoroverrideStdFeatures(int values, int mask)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.JsonGeneratoruseDefaultPrettyPrinter()No 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, java.io.InputStream data, int dataLength)intwriteBinary(java.io.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.voidwriteEndArray()voidwriteEndObject()voidwriteFieldId(long size)voidwriteFieldName(com.fasterxml.jackson.core.SerializableString name)voidwriteFieldName(java.lang.String name)voidwriteNull()voidwriteNumber(double d)voidwriteNumber(float f)voidwriteNumber(int i)voidwriteNumber(long l)voidwriteNumber(java.lang.String encodedValue)voidwriteNumber(java.math.BigDecimal dec)voidwriteNumber(java.math.BigInteger v)voidwriteRaw(byte b)Method for directly inserting specified byte in output at current position.voidwriteRaw(char c)voidwriteRaw(char[] text, int offset, int len)voidwriteRaw(java.lang.String text)voidwriteRaw(java.lang.String text, int offset, int len)voidwriteRawUTF8String(byte[] raw, int offset, int len)voidwriteRawValue(char[] text, int offset, int len)voidwriteRawValue(java.lang.String text)voidwriteRawValue(java.lang.String text, int offset, int len)voidwriteStartArray()voidwriteStartArray(int elementsToWrite)voidwriteStartObject()voidwriteStartObject(int elementsToWrite)voidwriteStartObject(java.lang.Object forValue)voidwriteString(char[] text, int offset, int len)voidwriteString(com.fasterxml.jackson.core.SerializableString sstr)voidwriteString(java.lang.String text)voidwriteStringField(java.lang.String fieldName, java.lang.String value)voidwriteTag(int tagId)Method for writing out an explicit CBOR Tag.voidwriteUTF8String(byte[] text, int offset, int len)-
Methods inherited from class com.fasterxml.jackson.core.base.GeneratorBase
_asString, _checkStdFeatureChanges, _constructDefaultPrettyPrinter, _decodeSurrogate, disable, enable, getCodec, getCurrentValue, getFeatureMask, getOutputContext, isClosed, isEnabled, setCodec, setCurrentValue, setFeatureMask, writeObject, writeRawValue, writeTree
-
Methods inherited from class com.fasterxml.jackson.core.JsonGenerator
_copyCurrentContents, _reportError, _reportUnsupportedOperation, _throwInternal, _verifyOffsets, _writeSimpleObject, canOmitFields, canUseSchema, canWriteFormattedNumbers, canWriteObjectId, canWriteTypeId, configure, 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, writeRaw, writeStartArray, writeStartArray, writeStartObject, writeString, writeTypeId, writeTypePrefix, writeTypeSuffix
-
-
-
-
Field Detail
-
NO_INTS
private static final int[] NO_INTS
-
BYTE_BUFFER_FOR_OUTPUT
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
MIN_INT_AS_LONG
private static final long MIN_INT_AS_LONG
- See Also:
- Constant Field Values
-
MAX_INT_AS_LONG
private static final long MAX_INT_AS_LONG
- See Also:
- Constant Field Values
-
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:
- Constant Field Values
-
_ioContext
protected final com.fasterxml.jackson.core.io.IOContext _ioContext
-
_out
protected final java.io.OutputStream _out
-
_formatFeatures
protected int _formatFeatures
Bit flag composed of bits that indicate whichCBORGenerator.Features are enabled.
-
_cfgMinimalInts
protected boolean _cfgMinimalInts
-
_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; markerINDEFINITE_LENGTHotherwise.
-
_bufferRecyclable
protected boolean _bufferRecyclable
Flag that indicates whether the output buffer is recycable (and needs to be returned to recycler once we are done) or not.
-
MAX_SHORT_STRING_CHARS
private static final int MAX_SHORT_STRING_CHARS
- See Also:
- Constant Field Values
-
MAX_SHORT_STRING_BYTES
private static final int MAX_SHORT_STRING_BYTES
- See Also:
- Constant Field Values
-
MAX_MEDIUM_STRING_CHARS
private static final int MAX_MEDIUM_STRING_CHARS
- See Also:
- Constant Field Values
-
MAX_MEDIUM_STRING_BYTES
private static final int MAX_MEDIUM_STRING_BYTES
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CBORGenerator
public CBORGenerator(com.fasterxml.jackson.core.io.IOContext ctxt, int stdFeatures, int formatFeatures, com.fasterxml.jackson.core.ObjectCodec codec, java.io.OutputStream out)
-
CBORGenerator
public CBORGenerator(com.fasterxml.jackson.core.io.IOContext ctxt, int stdFeatures, int formatFeatures, com.fasterxml.jackson.core.ObjectCodec codec, java.io.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 Detail
-
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
-
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
public java.lang.Object 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
-
enable
public CBORGenerator enable(CBORGenerator.Feature f)
-
disable
public CBORGenerator disable(CBORGenerator.Feature f)
-
isEnabled
public final boolean isEnabled(CBORGenerator.Feature f)
-
configure
public CBORGenerator configure(CBORGenerator.Feature f, boolean state)
-
writeFieldName
public final void writeFieldName(java.lang.String name) throws java.io.IOException- Specified by:
writeFieldNamein classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeFieldName
public final void writeFieldName(com.fasterxml.jackson.core.SerializableString name) throws java.io.IOException- Overrides:
writeFieldNamein classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
java.io.IOException
-
writeFieldId
public final void writeFieldId(long size) throws java.io.IOException- Overrides:
writeFieldIdin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeStringField
public final void writeStringField(java.lang.String fieldName, java.lang.String value) throws java.io.IOException- Overrides:
writeStringFieldin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
copyCurrentEvent
public void copyCurrentEvent(com.fasterxml.jackson.core.JsonParser p) throws java.io.IOExceptionSpecializeJsonGenerator.copyCurrentEvent(com.fasterxml.jackson.core.JsonParser)to handle tags.- Overrides:
copyCurrentEventin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
copyCurrentStructure
public void copyCurrentStructure(com.fasterxml.jackson.core.JsonParser p) throws java.io.IOExceptionSpecializeJsonGenerator.copyCurrentStructure(com.fasterxml.jackson.core.JsonParser)to handle tags.- Overrides:
copyCurrentStructurein classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
maybeCopyTag
protected void maybeCopyTag(com.fasterxml.jackson.core.JsonParser p) throws java.io.IOException- Throws:
java.io.IOException
-
writeStartArray
public final void writeStartArray() throws java.io.IOException- Specified by:
writeStartArrayin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeStartArray
public void writeStartArray(int elementsToWrite) throws java.io.IOException- Overrides:
writeStartArrayin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeEndArray
public final void writeEndArray() throws java.io.IOException- Specified by:
writeEndArrayin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeStartObject
public final void writeStartObject() throws java.io.IOException- Specified by:
writeStartObjectin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeStartObject
public final void writeStartObject(java.lang.Object forValue) throws java.io.IOException- Overrides:
writeStartObjectin classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
java.io.IOException
-
writeStartObject
public final void writeStartObject(int elementsToWrite) throws java.io.IOException- Throws:
java.io.IOException
-
writeEndObject
public final void writeEndObject() throws java.io.IOException- Specified by:
writeEndObjectin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeArray
public void writeArray(int[] array, int offset, int length) throws java.io.IOException- Overrides:
writeArrayin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeArray
public void writeArray(long[] array, int offset, int length) throws java.io.IOException- Overrides:
writeArrayin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeArray
public void writeArray(double[] array, int offset, int length) throws java.io.IOException- Overrides:
writeArrayin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
_pushRemainingElements
private final void _pushRemainingElements()
-
_writeNumberNoCheck
private final void _writeNumberNoCheck(int i) throws java.io.IOException- Throws:
java.io.IOException
-
_writeNumberNoCheck
private final void _writeNumberNoCheck(long l) throws java.io.IOException- Throws:
java.io.IOException
-
_writeNumberNoCheck
private final void _writeNumberNoCheck(double d) throws java.io.IOException- Throws:
java.io.IOException
-
writeString
public void writeString(java.lang.String text) throws java.io.IOException- Specified by:
writeStringin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeString
public final void writeString(com.fasterxml.jackson.core.SerializableString sstr) throws java.io.IOException- Overrides:
writeStringin classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
java.io.IOException
-
writeString
public void writeString(char[] text, int offset, int len) throws java.io.IOException- Specified by:
writeStringin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeRawUTF8String
public void writeRawUTF8String(byte[] raw, int offset, int len) throws java.io.IOException- Specified by:
writeRawUTF8Stringin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeUTF8String
public final void writeUTF8String(byte[] text, int offset, int len) throws java.io.IOException- Specified by:
writeUTF8Stringin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeRaw
public void writeRaw(java.lang.String text) throws java.io.IOException- Specified by:
writeRawin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeRaw
public void writeRaw(java.lang.String text, int offset, int len) throws java.io.IOException- Specified by:
writeRawin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeRaw
public void writeRaw(char[] text, int offset, int len) throws java.io.IOException- Specified by:
writeRawin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeRaw
public void writeRaw(char c) throws java.io.IOException- Specified by:
writeRawin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeRawValue
public void writeRawValue(java.lang.String text) throws java.io.IOException- Overrides:
writeRawValuein classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
java.io.IOException
-
writeRawValue
public void writeRawValue(java.lang.String text, int offset, int len) throws java.io.IOException- Overrides:
writeRawValuein classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
java.io.IOException
-
writeRawValue
public void writeRawValue(char[] text, int offset, int len) throws java.io.IOException- Overrides:
writeRawValuein classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
java.io.IOException
-
writeBinary
public void writeBinary(com.fasterxml.jackson.core.Base64Variant b64variant, byte[] data, int offset, int len) throws java.io.IOException- Specified by:
writeBinaryin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeBinary
public int writeBinary(java.io.InputStream data, int dataLength) throws java.io.IOException- Overrides:
writeBinaryin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeBinary
public int writeBinary(com.fasterxml.jackson.core.Base64Variant b64variant, java.io.InputStream data, int dataLength) throws java.io.IOException- Overrides:
writeBinaryin classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
java.io.IOException
-
writeBoolean
public void writeBoolean(boolean state) throws java.io.IOException- Specified by:
writeBooleanin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeNull
public void writeNull() throws java.io.IOException- Specified by:
writeNullin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeNumber
public void writeNumber(int i) throws java.io.IOException- Specified by:
writeNumberin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeNumber
public void writeNumber(long l) throws java.io.IOException- Specified by:
writeNumberin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeNumber
public void writeNumber(java.math.BigInteger v) throws java.io.IOException- Specified by:
writeNumberin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
_write
protected void _write(java.math.BigInteger v) throws java.io.IOException- Throws:
java.io.IOException
-
writeNumber
public void writeNumber(double d) throws java.io.IOException- Specified by:
writeNumberin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeNumber
public void writeNumber(float f) throws java.io.IOException- Specified by:
writeNumberin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeNumber
public void writeNumber(java.math.BigDecimal dec) throws java.io.IOException- Specified by:
writeNumberin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOException
-
writeNumber
public void writeNumber(java.lang.String encodedValue) throws java.io.IOException, com.fasterxml.jackson.core.JsonGenerationException, java.lang.UnsupportedOperationException- Specified by:
writeNumberin classcom.fasterxml.jackson.core.JsonGenerator- Throws:
java.io.IOExceptioncom.fasterxml.jackson.core.JsonGenerationExceptionjava.lang.UnsupportedOperationException
-
_verifyValueWrite
protected final void _verifyValueWrite(java.lang.String typeMsg) throws java.io.IOException- Specified by:
_verifyValueWritein classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
java.io.IOException
-
_failSizedArrayOrObject
private void _failSizedArrayOrObject() throws java.io.IOException- Throws:
java.io.IOException
-
flush
public final void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Specified by:
flushin classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classcom.fasterxml.jackson.core.base.GeneratorBase- Throws:
java.io.IOException
-
writeTag
public void writeTag(int tagId) throws java.io.IOExceptionMethod for writing out an explicit CBOR Tag.- Parameters:
tagId- Positive integer (0 or higher)- Throws:
java.io.IOException- Since:
- 2.5
-
writeRaw
public void writeRaw(byte b) throws java.io.IOExceptionMethod for directly inserting specified byte in output at current position.NOTE: only use this method if you really know what you are doing.
- Throws:
java.io.IOException
-
writeBytes
public void writeBytes(byte[] data, int offset, int len) throws java.io.IOExceptionMethod for directly inserting specified bytes in output at current position.NOTE: only use this method if you really know what you are doing.
- Throws:
java.io.IOException
-
_writeString
protected final void _writeString(java.lang.String name) throws java.io.IOException- Throws:
java.io.IOException
-
_ensureSpace
protected final void _ensureSpace(int needed) throws java.io.IOException- Throws:
java.io.IOException
-
_writeString
protected final void _writeString(char[] text, int offset, int len) throws java.io.IOException- Throws:
java.io.IOException
-
_writeChunkedString
protected final void _writeChunkedString(char[] text, int offset, int len) throws java.io.IOException- Throws:
java.io.IOException
-
_encode
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.
-
_shortUTF8Encode2
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.
-
_encode
private final int _encode(int outputPtr, java.lang.String str, int len)
-
_encode2
private final int _encode2(int i, int outputPtr, java.lang.String str, int len, int outputStart)
-
_convertSurrogate
private int _convertSurrogate(int firstPart, int secondPart)Method called to calculate UTF codepoint, from a surrogate pair.
-
_throwIllegalSurrogate
private void _throwIllegalSurrogate(int code)
-
_ensureRoomForOutput
private final void _ensureRoomForOutput(int needed) throws java.io.IOException- Throws:
java.io.IOException
-
_writeIntValue
private final void _writeIntValue(int i) throws java.io.IOException- Throws:
java.io.IOException
-
_writeLongValue
private final void _writeLongValue(long l) throws java.io.IOException- Throws:
java.io.IOException
-
_writeLengthMarker
private final void _writeLengthMarker(int majorType, int i) throws java.io.IOException- Throws:
java.io.IOException
-
_writeByte
private final void _writeByte(byte b) throws java.io.IOException- Throws:
java.io.IOException
-
_writeBytes
private final void _writeBytes(byte[] data, int offset, int len) throws java.io.IOException- Throws:
java.io.IOException
-
_writeBytes
private final int _writeBytes(java.io.InputStream in, int bytesLeft) throws java.io.IOException- Throws:
java.io.IOException
-
_writeBytesLong
private final void _writeBytesLong(byte[] data, int offset, int len) throws java.io.IOException- Throws:
java.io.IOException
-
_releaseBuffers
protected void _releaseBuffers()
- Specified by:
_releaseBuffersin classcom.fasterxml.jackson.core.base.GeneratorBase
-
_flushBuffer
protected final void _flushBuffer() throws java.io.IOException- Throws:
java.io.IOException
-
closeComplexElement
private final void closeComplexElement() throws java.io.IOException- Throws:
java.io.IOException
-
_notSupported
protected java.lang.UnsupportedOperationException _notSupported()
-
-