Class SmileGenerator
java.lang.Object
com.fasterxml.jackson.core.JsonGenerator
com.fasterxml.jackson.core.base.GeneratorBase
com.fasterxml.jackson.dataformat.smile.SmileGenerator
- All Implemented Interfaces:
com.fasterxml.jackson.core.Versioned
,Closeable
,Flushable
,AutoCloseable
public class SmileGenerator
extends com.fasterxml.jackson.core.base.GeneratorBase
JsonGenerator
implementation for Smile-encoded content
(see Smile Format Specification)-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enumeration that defines all togglable features for Smile generators.static final class
Helper class used for keeping track of possibly shareable String references (for field names and/or short String values) -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected 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 int
Bit flag composed of bits that indicate whichSmileGenerator.Feature
s 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
protected int
Number of entries in_seenNames
; -1 if no shared name detection is enabledprotected SmileGenerator.SharedStringNode[]
Raw data structure used for checking whether field name to write can be output using back reference or not.protected int
Number of entries in_seenStringValues
; -1 if no shared text value detection is enabledprotected SmileGenerator.SharedStringNode[]
Raw data structure used for checking whether String value to write can be output using back reference or not.protected final com.fasterxml.jackson.core.StreamWriteConstraints
protected SmileWriteContext
protected static final int
protected static final int
protected static final long
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.protected static final long
protected static final int
The replacement character to use to fix invalid Unicode sequences (mismatched surrogate pair).protected static final byte
protected static final byte
protected static final byte
protected static final byte
protected static final byte
protected static final byte
protected static final byte
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_STRING
Fields inherited from class com.fasterxml.jackson.core.JsonGenerator
_cfgPrettyPrinter, DEFAULT_BINARY_WRITE_CAPABILITIES, DEFAULT_TEXTUAL_WRITE_CAPABILITIES, DEFAULT_WRITE_CAPABILITIES
-
Constructor Summary
ConstructorsConstructorDescriptionSmileGenerator
(com.fasterxml.jackson.core.io.IOContext ioCtxt, int stdFeatures, int smileFeatures, com.fasterxml.jackson.core.ObjectCodec codec, OutputStream out) SmileGenerator
(com.fasterxml.jackson.core.io.IOContext ioCtxt, int stdFeatures, int smileFeatures, com.fasterxml.jackson.core.ObjectCodec codec, OutputStream out, byte[] outputBuffer, int offset, boolean bufferRecyclable) -
Method Summary
Modifier and TypeMethodDescriptionprivate final void
_addSeenName
(String name) private final void
_addSeenStringValue
(String text) private int
_appendReplacementChar
(byte[] outBuf, int outputPtr) private int
_decodeAndWriteSurrogate
(int surr1, int surr2, byte[] outBuf, int outputPtr) private final void
_ensureRoomForOutput
(int needed) private final int
_findSeenName
(String name) private final int
_findSeenStringValue
(String text) protected final void
private int
_invalidSurrogateEnd
(int surr1, int surr2, byte[] outBuf, int outputPtr) private int
_invalidSurrogateStart
(int code, byte[] outBuf, int outputPtr) private void
_mediumUTF8Encode
(char[] str, int inputPtr, int inputEnd) private void
_mediumUTF8Encode
(String str, int inputPtr, int inputEnd) protected UnsupportedOperationException
private int
_readMore
(InputStream in, byte[] readBuffer, int inputPtr, int inputEnd, int maxRead) protected void
private final int
_shortUTF8Encode
(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
_shortUTF8Encode
(String str, int i, int end) private final int
_shortUTF8Encode2
(char[] str, int i, int end, int outputPtr) 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 final int
_shortUTF8Encode2
(String str, int i, int end, int outputPtr) protected com.fasterxml.jackson.core.StreamReadConstraints
We need access to some reader-side constraints for safety-check within number decoding for : for now we need to rely on global defaults; should be ok for basic safeguarding.private static final boolean
_validBackRef
(int index) Helper method used to ensure that we do not use back-reference values that would produce illegal byte sequences (ones with byte 0xFE or 0xFF).protected final void
_verifyValueWrite
(String typeMsg) protected void
_write7BitBinaryWithLength
(byte[] data, int offset, int len) protected int
_write7BitBinaryWithLength
(InputStream in, int bytesLeft, byte[] buffer) private final void
_writeByte
(byte b) private final void
_writeBytes
(byte[] data, int offset, int len) private final void
_writeBytes
(byte b1, byte b2) private final void
_writeBytes
(byte b1, byte b2, byte b3) private final void
_writeBytes
(byte b1, byte b2, byte b3, byte b4) private final void
_writeBytes
(byte b1, byte b2, byte b3, byte b4, byte b5) private final void
_writeBytes
(byte b1, byte b2, byte b3, byte b4, byte b5, byte b6) private final int
_writeBytes
(InputStream in, int bytesLeft) private final void
_writeBytesLong
(byte[] data, int offset, int len) protected void
protected final void
_writeFieldName
(com.fasterxml.jackson.core.SerializableString name) private final void
_writeFieldName
(String name) protected final void
_writeFieldNameUnicode
(com.fasterxml.jackson.core.SerializableString name, byte[] bytes) protected void
_writeIntegralNumber
(String enc, boolean neg) private final void
_writeLongAsciiFieldName
(byte[] bytes) private final void
_writeNonSharedString
(String text, int len) Helper method called to handle cases where String value to write is known to be long enough not to be shareable.private final void
_writeNonShortFieldName
(String name, int len) private final int
_writeNumberNoChecks
(int ptr, double d) private final int
_writeNumberNoChecks
(int ptr, int i) private final int
_writeNumberNoChecks
(int ptr, long l) private void
_writePositiveVInt
(int i) Helper method for writing a 32-bit positive (really 31-bit then) value.private final void
_writeSharedNameReference
(int ix) private final void
_writeSharedStringValueReference
(int ix) private void
_writeSignedVInt
(int input) Helper method for writing 32-bit signed value, using "zig zag encoding" (see protocol buffers for explanation -- basically, sign bit is moved as LSB, rest of value shifted left by one) coupled with basic variable length encodingvoid
boolean
void
close()
configure
(SmileGenerator.Feature f, boolean state) final void
flush()
Deprecated.int
int
com.fasterxml.jackson.core.JsonStreamContext
com.fasterxml.jackson.core.util.JacksonFeatureSet
<com.fasterxml.jackson.core.StreamWriteCapability> final boolean
protected long
Method for accessing offset of the next byte within the whole output stream that this generator has produced.com.fasterxml.jackson.core.JsonGenerator
overrideFormatFeatures
(int values, int mask) void
Deprecated.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.com.fasterxml.jackson.core.StreamWriteConstraints
com.fasterxml.jackson.core.JsonGenerator
No way (or need) to indent anything, so let's block any attempts.com.fasterxml.jackson.core.Version
version()
void
writeArray
(double[] array, int offset, int length) void
writeArray
(int[] array, int offset, int length) void
writeArray
(long[] array, int offset, int length) void
writeBinary
(com.fasterxml.jackson.core.Base64Variant b64variant, byte[] data, int offset, int len) int
writeBinary
(com.fasterxml.jackson.core.Base64Variant b64variant, InputStream data, int dataLength) int
writeBinary
(InputStream data, int dataLength) void
writeBoolean
(boolean state) void
writeBytes
(byte[] data, int offset, int len) Method for directly inserting specified bytes in output at current position.final void
final void
final void
writeFieldName
(com.fasterxml.jackson.core.SerializableString name) final void
writeFieldName
(String name) void
Method that can be called to explicitly write Smile document header.void
void
writeNumber
(double d) void
writeNumber
(float f) void
writeNumber
(int i) void
writeNumber
(long l) void
writeNumber
(String encodedValue) void
writeNumber
(BigDecimal dec) void
void
writeRaw
(byte b) Method for directly inserting specified byte in output at current position.void
writeRaw
(char c) void
writeRaw
(char[] text, int offset, int len) void
void
void
writeRawUTF8String
(byte[] text, int offset, int len) void
writeRawValue
(char[] text, int offset, int len) void
writeRawValue
(String text) void
writeRawValue
(String text, int offset, int len) final void
final void
writeStartArray
(int size) Deprecated.final void
writeStartArray
(Object forValue) final void
writeStartArray
(Object forValue, int elementsToWrite) final void
final void
writeStartObject
(Object forValue) void
writeStartObject
(Object forValue, int elementsToWrite) void
writeString
(char[] text, int offset, int len) final void
writeString
(com.fasterxml.jackson.core.SerializableString sstr) void
writeString
(String text) final void
writeUTF8String
(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, overrideStdFeatures, setCodec, setFeatureMask, writeObject, writeRawValue, writeTree
Methods 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, writeFieldId, 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
-
DEFAULT_NAME_BUFFER_LENGTH
protected static final int DEFAULT_NAME_BUFFER_LENGTH- See Also:
-
DEFAULT_STRING_VALUE_BUFFER_LENGTH
protected static final int DEFAULT_STRING_VALUE_BUFFER_LENGTH- 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:
-
TOKEN_BYTE_LONG_STRING_ASCII
protected static final byte TOKEN_BYTE_LONG_STRING_ASCII- See Also:
-
TOKEN_BYTE_INT_32
protected static final byte TOKEN_BYTE_INT_32- See Also:
-
TOKEN_BYTE_INT_64
protected static final byte TOKEN_BYTE_INT_64- See Also:
-
TOKEN_BYTE_BIG_INTEGER
protected static final byte TOKEN_BYTE_BIG_INTEGER- See Also:
-
TOKEN_BYTE_FLOAT_32
protected static final byte TOKEN_BYTE_FLOAT_32- See Also:
-
TOKEN_BYTE_FLOAT_64
protected static final byte TOKEN_BYTE_FLOAT_64- See Also:
-
TOKEN_BYTE_BIG_DECIMAL
protected static final byte TOKEN_BYTE_BIG_DECIMAL- See Also:
-
MIN_INT_AS_LONG
protected static final long MIN_INT_AS_LONG- See Also:
-
MAX_INT_AS_LONG
protected static final long MAX_INT_AS_LONG- See Also:
-
REPLACEMENT_CHAR
protected static final int REPLACEMENT_CHARThe replacement character to use to fix invalid Unicode sequences (mismatched surrogate pair).- Since:
- 2.13
- 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 whichSmileGenerator.Feature
s are enabled. -
_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. -
_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. -
_seenNames
Raw data structure used for checking whether field name to write can be output using back reference or not. -
_seenNameCount
protected int _seenNameCountNumber of entries in_seenNames
; -1 if no shared name detection is enabled -
_seenStringValues
Raw data structure used for checking whether String value to write can be output using back reference or not. -
_seenStringValueCount
protected int _seenStringValueCountNumber of entries in_seenStringValues
; -1 if no shared text value detection is enabled -
_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.
-
-
Constructor Details
-
SmileGenerator
public SmileGenerator(com.fasterxml.jackson.core.io.IOContext ioCtxt, int stdFeatures, int smileFeatures, com.fasterxml.jackson.core.ObjectCodec codec, OutputStream out) - Since:
- 2.16
-
SmileGenerator
public SmileGenerator(com.fasterxml.jackson.core.io.IOContext ioCtxt, int stdFeatures, int smileFeatures, com.fasterxml.jackson.core.ObjectCodec codec, OutputStream out, byte[] outputBuffer, int offset, boolean bufferRecyclable) - Since:
- 2.16
-
-
Method Details
-
writeHeader
Method that can be called to explicitly write Smile document header. Note that usually you do not need to call this for first document to output, but rather only if you intend to write multiple root-level documents with same generator (and even in that case this is optional thing to do). As a result usually onlySmileFactory
calls this method.- Throws:
IOException
-
version
public com.fasterxml.jackson.core.Version version()- Specified by:
version
in interfacecom.fasterxml.jackson.core.Versioned
- Overrides:
version
in classcom.fasterxml.jackson.core.base.GeneratorBase
-
canWriteBinaryNatively
public boolean canWriteBinaryNatively()- Overrides:
canWriteBinaryNatively
in classcom.fasterxml.jackson.core.JsonGenerator
-
getWriteCapabilities
public com.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamWriteCapability> getWriteCapabilities()- Overrides:
getWriteCapabilities
in 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:
useDefaultPrettyPrinter
in 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:
setPrettyPrinter
in classcom.fasterxml.jackson.core.JsonGenerator
-
getOutputTarget
- Overrides:
getOutputTarget
in classcom.fasterxml.jackson.core.JsonGenerator
-
getOutputBuffered
public int getOutputBuffered()- Overrides:
getOutputBuffered
in classcom.fasterxml.jackson.core.JsonGenerator
-
getFormatFeatures
public int getFormatFeatures()- Overrides:
getFormatFeatures
in classcom.fasterxml.jackson.core.JsonGenerator
-
overrideFormatFeatures
public com.fasterxml.jackson.core.JsonGenerator overrideFormatFeatures(int values, int mask) - Overrides:
overrideFormatFeatures
in classcom.fasterxml.jackson.core.JsonGenerator
-
getOutputContext
public com.fasterxml.jackson.core.JsonStreamContext getOutputContext()- Overrides:
getOutputContext
in classcom.fasterxml.jackson.core.base.GeneratorBase
-
currentValue
- Overrides:
currentValue
in classcom.fasterxml.jackson.core.base.GeneratorBase
-
assignCurrentValue
- Overrides:
assignCurrentValue
in classcom.fasterxml.jackson.core.base.GeneratorBase
-
getCurrentValue
Deprecated.- Overrides:
getCurrentValue
in classcom.fasterxml.jackson.core.JsonGenerator
-
setCurrentValue
Deprecated.- Overrides:
setCurrentValue
in classcom.fasterxml.jackson.core.JsonGenerator
-
writeFieldName
- Specified by:
writeFieldName
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeFieldName
public final void writeFieldName(com.fasterxml.jackson.core.SerializableString name) throws IOException - Overrides:
writeFieldName
in classcom.fasterxml.jackson.core.base.GeneratorBase
- Throws:
IOException
-
enable
-
disable
-
isEnabled
-
configure
-
streamWriteConstraints
public com.fasterxml.jackson.core.StreamWriteConstraints streamWriteConstraints()- Overrides:
streamWriteConstraints
in classcom.fasterxml.jackson.core.JsonGenerator
-
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
-
writeStartArray
- Specified by:
writeStartArray
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeStartArray
- Overrides:
writeStartArray
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeStartArray
- Overrides:
writeStartArray
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeStartArray
Deprecated.- Overrides:
writeStartArray
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeEndArray
- Specified by:
writeEndArray
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeStartObject
- Specified by:
writeStartObject
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeStartObject
- Overrides:
writeStartObject
in classcom.fasterxml.jackson.core.base.GeneratorBase
- Throws:
IOException
-
writeStartObject
- Overrides:
writeStartObject
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeEndObject
- Specified by:
writeEndObject
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeArray
- Overrides:
writeArray
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeArray
- Overrides:
writeArray
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeArray
- Overrides:
writeArray
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
_writeFieldName
- Throws:
IOException
-
_writeNonShortFieldName
- Throws:
IOException
-
_writeFieldName
protected final void _writeFieldName(com.fasterxml.jackson.core.SerializableString name) throws IOException - Throws:
IOException
-
_writeLongAsciiFieldName
- Throws:
IOException
-
_writeFieldNameUnicode
protected final void _writeFieldNameUnicode(com.fasterxml.jackson.core.SerializableString name, byte[] bytes) throws IOException - Throws:
IOException
-
writeString
- Specified by:
writeString
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeString
- Specified by:
writeString
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeString
public final void writeString(com.fasterxml.jackson.core.SerializableString sstr) throws IOException - Overrides:
writeString
in classcom.fasterxml.jackson.core.base.GeneratorBase
- Throws:
IOException
-
writeRawUTF8String
- Specified by:
writeRawUTF8String
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeUTF8String
- Specified by:
writeUTF8String
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeRaw
- Specified by:
writeRaw
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeRaw
- Specified by:
writeRaw
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeRaw
- Specified by:
writeRaw
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeRaw
- Specified by:
writeRaw
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeRawValue
- Overrides:
writeRawValue
in classcom.fasterxml.jackson.core.base.GeneratorBase
- Throws:
IOException
-
writeRawValue
- Overrides:
writeRawValue
in classcom.fasterxml.jackson.core.base.GeneratorBase
- Throws:
IOException
-
writeRawValue
- Overrides:
writeRawValue
in 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:
writeBinary
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeBinary
- Overrides:
writeBinary
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeBinary
public int writeBinary(com.fasterxml.jackson.core.Base64Variant b64variant, InputStream data, int dataLength) throws IOException - Overrides:
writeBinary
in classcom.fasterxml.jackson.core.base.GeneratorBase
- Throws:
IOException
-
writeBoolean
- Specified by:
writeBoolean
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeNull
- Specified by:
writeNull
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeNumber
- Specified by:
writeNumber
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
_writeNumberNoChecks
- Throws:
IOException
-
writeNumber
- Specified by:
writeNumber
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
_writeNumberNoChecks
- Throws:
IOException
-
writeNumber
- Specified by:
writeNumber
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeNumber
- Specified by:
writeNumber
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
_writeNumberNoChecks
- Throws:
IOException
-
writeNumber
- Specified by:
writeNumber
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeNumber
- Specified by:
writeNumber
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
writeNumber
- Specified by:
writeNumber
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
IOException
-
_writeIntegralNumber
- Throws:
IOException
-
_writeDecimalNumber
- Throws:
IOException
-
_verifyValueWrite
- Specified by:
_verifyValueWrite
in classcom.fasterxml.jackson.core.base.GeneratorBase
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in classcom.fasterxml.jackson.core.base.GeneratorBase
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classcom.fasterxml.jackson.core.base.GeneratorBase
- Throws:
IOException
-
_shortUTF8Encode
Helper method called when the whole character sequence is known to fit in the output buffer regardless of UTF-8 expansion.- Throws:
IOException
-
_shortUTF8Encode2
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
-
_shortUTF8Encode
- Throws:
IOException
-
_shortUTF8Encode2
- Throws:
IOException
-
_mediumUTF8Encode
- Throws:
IOException
-
_mediumUTF8Encode
- 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
-
_writeByte
- Throws:
IOException
-
_writeBytes
- Throws:
IOException
-
_writeBytes
- Throws:
IOException
-
_writeBytes
- Throws:
IOException
-
_writeBytes
- Throws:
IOException
-
_writeBytes
private final void _writeBytes(byte b1, byte b2, byte b3, byte b4, byte b5, byte b6) throws IOException - Throws:
IOException
-
_writeBytes
- Throws:
IOException
-
_writeBytes
- Throws:
IOException
-
_writeBytesLong
- Throws:
IOException
-
_writePositiveVInt
Helper method for writing a 32-bit positive (really 31-bit then) value. Value is NOT zigzag encoded (since there is no sign bit to worry about)- Throws:
IOException
-
_writeSignedVInt
Helper method for writing 32-bit signed value, using "zig zag encoding" (see protocol buffers for explanation -- basically, sign bit is moved as LSB, rest of value shifted left by one) coupled with basic variable length encoding- Throws:
IOException
-
_write7BitBinaryWithLength
- Throws:
IOException
-
_write7BitBinaryWithLength
protected int _write7BitBinaryWithLength(InputStream in, int bytesLeft, byte[] buffer) throws IOException - Throws:
IOException
-
_readMore
private int _readMore(InputStream in, byte[] readBuffer, int inputPtr, int inputEnd, int maxRead) throws IOException - Throws:
IOException
-
_releaseBuffers
protected void _releaseBuffers()- Specified by:
_releaseBuffers
in classcom.fasterxml.jackson.core.base.GeneratorBase
-
_flushBuffer
- Throws:
IOException
-
_findSeenName
-
_addSeenName
-
_findSeenStringValue
-
_addSeenStringValue
-
_validBackRef
private static final boolean _validBackRef(int index) Helper method used to ensure that we do not use back-reference values that would produce illegal byte sequences (ones with byte 0xFE or 0xFF). Note that we do not try to avoid null byte (0x00) by default, although it would be technically possible as well. -
outputOffset
protected long outputOffset()Method for accessing offset of the next byte within the whole output stream that this generator has produced. -
_notSupported
-
_streamReadConstraints
protected com.fasterxml.jackson.core.StreamReadConstraints _streamReadConstraints()We need access to some reader-side constraints for safety-check within number decoding for : for now we need to rely on global defaults; should be ok for basic safeguarding.- Since:
- 2.17
-