Class SmileGenerator
java.lang.Object
tools.jackson.core.JsonGenerator
tools.jackson.core.base.GeneratorBase
tools.jackson.dataformat.smile.SmileGenerator
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, tools.jackson.core.Versioned
public class SmileGenerator
extends tools.jackson.core.base.GeneratorBase
JsonGenerator implementation for Smile-encoded content
(see Smile Format Specification)-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classHelper class used for keeping track of possibly shareable String references (for property names and/or short String values) -
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 intBit flag composed of bits that indicate whichSmileWriteFeatures 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 intNumber of entries in_seenNames; -1 if no shared name detection is enabledprotected SmileGenerator.SharedStringNode[]Raw data structure used for checking whether property name to write can be output using back reference or not.protected intNumber 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 tools.jackson.core.util.SimpleStreamWriteContextObject that keeps track of the current contextual state of the generator.protected static final intprotected static final intprotected static final longprivate static final intTo simplify certain operations, we require output buffer length to allow outputting of contiguous 256 character UTF-8 encoded String value.protected static final longprotected static final intThe replacement character to use to fix invalid Unicode sequences (mismatched surrogate pair).protected static final byteprotected static final byteprotected static final byteprotected static final byteprotected static final byteprotected static final byteprotected static final byteFields 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
ConstructorsConstructorDescriptionSmileGenerator(tools.jackson.core.ObjectWriteContext writeCtxt, tools.jackson.core.io.IOContext ioCtxt, int streamWriteFeatures, int smileFeatures, OutputStream out) SmileGenerator(tools.jackson.core.ObjectWriteContext writeCtxt, tools.jackson.core.io.IOContext ioCtxt, int streamWriteFeatures, int smileFeatures, 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) protected voidprivate 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 voidprivate 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 UnsupportedOperationExceptionprivate int_readMore(InputStream in, byte[] readBuffer, int inputPtr, int inputEnd, int maxRead) protected voidprivate 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 tools.jackson.core.StreamReadConstraintsWe 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 voidprotected void_writeIntegralNumber(String enc, boolean neg) private final void_writeLongAsciiFieldName(byte[] bytes) private final void_writeName(String name) protected final void_writeName(tools.jackson.core.SerializableString name) protected final void_writeNameUnicode(tools.jackson.core.SerializableString name, 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 encodingvoidconfigure(SmileWriteFeature f, boolean state) final voidflush()tools.jackson.core.PrettyPrinterfinal booleanprotected longMethod for accessing offset of the next byte within the whole output stream that this generator has produced.tools.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.JsonGeneratorMethod that can be called to explicitly write Smile document header.tools.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.JsonGeneratortools.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[] text, 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 forValue) tools.jackson.core.JsonGeneratorwriteStartArray(Object forValue, int size) tools.jackson.core.JsonGeneratortools.jackson.core.JsonGeneratorwriteStartObject(Object forValue) tools.jackson.core.JsonGeneratorwriteStartObject(Object forValue, int size) 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.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
-
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).- See Also:
-
_out
-
_formatFeatures
protected int _formatFeaturesBit flag composed of bits that indicate whichSmileWriteFeatures are enabled. -
_streamWriteContext
protected tools.jackson.core.util.SimpleStreamWriteContext _streamWriteContextObject that keeps track of the current contextual state of the generator. -
_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 property 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(tools.jackson.core.ObjectWriteContext writeCtxt, tools.jackson.core.io.IOContext ioCtxt, int streamWriteFeatures, int smileFeatures, OutputStream out) -
SmileGenerator
public SmileGenerator(tools.jackson.core.ObjectWriteContext writeCtxt, tools.jackson.core.io.IOContext ioCtxt, int streamWriteFeatures, int smileFeatures, OutputStream out, byte[] outputBuffer, int offset, boolean bufferRecyclable)
-
-
Method Details
-
writeHeader
public tools.jackson.core.JsonGenerator writeHeader() throws tools.jackson.core.JacksonExceptionMethod 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 onlySmileFactorycalls this method.- Throws:
tools.jackson.core.JacksonException
-
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
-
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
-
enable
-
disable
-
isEnabled
-
configure
-
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
-
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 forValue) 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 size) 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 size) 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
-
_writeName
- Throws:
tools.jackson.core.JacksonException
-
_writeNonShortFieldName
private final void _writeNonShortFieldName(String name, int len) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_writeName
protected final void _writeName(tools.jackson.core.SerializableString name) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_writeLongAsciiFieldName
private final void _writeLongAsciiFieldName(byte[] bytes) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_writeNameUnicode
protected final void _writeNameUnicode(tools.jackson.core.SerializableString name, byte[] bytes) 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(char[] text, int offset, int len) 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
-
writeRawUTF8String
public tools.jackson.core.JsonGenerator writeRawUTF8String(byte[] text, 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
-
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
-
_writeNumberNoChecks
private final int _writeNumberNoChecks(int ptr, int i) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
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
-
_writeNumberNoChecks
private final int _writeNumberNoChecks(int ptr, long l) throws tools.jackson.core.JacksonException - 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
-
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
-
_writeNumberNoChecks
private final int _writeNumberNoChecks(int ptr, double d) throws tools.jackson.core.JacksonException - 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
-
_writeIntegralNumber
protected void _writeIntegralNumber(String enc, boolean neg) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_writeDecimalNumber
- Throws:
tools.jackson.core.JacksonException
-
_verifyValueWrite
- Specified by:
_verifyValueWritein classtools.jackson.core.base.GeneratorBase- Throws:
tools.jackson.core.JacksonException
-
flush
-
_closeInput
- Specified by:
_closeInputin classtools.jackson.core.base.GeneratorBase- Throws:
IOException
-
_shortUTF8Encode
private final int _shortUTF8Encode(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) 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
-
_shortUTF8Encode
private final int _shortUTF8Encode(String str, int i, int end) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_shortUTF8Encode2
private final int _shortUTF8Encode2(String str, int i, int end, int outputPtr) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_mediumUTF8Encode
private void _mediumUTF8Encode(char[] str, int inputPtr, int inputEnd) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_mediumUTF8Encode
private void _mediumUTF8Encode(String str, int inputPtr, int inputEnd) 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
-
_writeByte
private final void _writeByte(byte b) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_writeBytes
private final void _writeBytes(byte b1, byte b2) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_writeBytes
private final void _writeBytes(byte b1, byte b2, byte b3) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_writeBytes
private final void _writeBytes(byte b1, byte b2, byte b3, byte b4) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_writeBytes
private final void _writeBytes(byte b1, byte b2, byte b3, byte b4, byte b5) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_writeBytes
private final void _writeBytes(byte b1, byte b2, byte b3, byte b4, byte b5, byte b6) 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
-
_writePositiveVInt
private void _writePositiveVInt(int i) throws tools.jackson.core.JacksonException 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:
tools.jackson.core.JacksonException
-
_writeSignedVInt
private void _writeSignedVInt(int input) throws tools.jackson.core.JacksonException 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:
tools.jackson.core.JacksonException
-
_write7BitBinaryWithLength
protected void _write7BitBinaryWithLength(byte[] data, int offset, int len) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_write7BitBinaryWithLength
protected int _write7BitBinaryWithLength(InputStream in, int bytesLeft, byte[] buffer) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_readMore
private int _readMore(InputStream in, byte[] readBuffer, int inputPtr, int inputEnd, int maxRead) 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
-
_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 tools.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
-