Class NonBlockingByteArrayParser
java.lang.Object
com.fasterxml.jackson.core.JsonParser
com.fasterxml.jackson.core.base.ParserMinimalBase
com.fasterxml.jackson.dataformat.smile.SmileParserBase
com.fasterxml.jackson.dataformat.smile.async.NonBlockingParserBase
com.fasterxml.jackson.dataformat.smile.async.NonBlockingByteArrayParser
- All Implemented Interfaces:
com.fasterxml.jackson.core.async.ByteArrayFeeder
,com.fasterxml.jackson.core.async.NonBlockingInputFeeder
,com.fasterxml.jackson.core.Versioned
,Closeable
,AutoCloseable
public class NonBlockingByteArrayParser
extends NonBlockingParserBase
implements com.fasterxml.jackson.core.async.ByteArrayFeeder
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.core.JsonParser
com.fasterxml.jackson.core.JsonParser.Feature, com.fasterxml.jackson.core.JsonParser.NumberType, com.fasterxml.jackson.core.JsonParser.NumberTypeFP
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]
This buffer is actually provided viaNonBlockingInputFeeder
protected int
In addition to current buffer pointer, and end pointer, we will also need to know number of bytes originally contained.Fields inherited from class com.fasterxml.jackson.dataformat.smile.async.NonBlockingParserBase
_byteArrayBuilder, _endOfInput, _inputCopy, _inputCopyLen, _majorState, _majorStateAfterValue, _minorState, _pending32, _pending64, MAJOR_ARRAY_ELEMENT, MAJOR_CLOSED, MAJOR_INITIAL, MAJOR_OBJECT_FIELD, MAJOR_OBJECT_VALUE, MAJOR_ROOT, MINOR_FIELD_NAME_2BYTE, MINOR_FIELD_NAME_LONG, MINOR_FIELD_NAME_SHORT_ASCII, MINOR_FIELD_NAME_SHORT_UNICODE, MINOR_HEADER_INITIAL, MINOR_HEADER_INLINE, MINOR_VALUE_BINARY_7BIT_BODY, MINOR_VALUE_BINARY_7BIT_LEN, MINOR_VALUE_BINARY_RAW_BODY, MINOR_VALUE_BINARY_RAW_LEN, MINOR_VALUE_NUMBER_BIGDEC_BODY, MINOR_VALUE_NUMBER_BIGDEC_LEN, MINOR_VALUE_NUMBER_BIGDEC_SCALE, MINOR_VALUE_NUMBER_BIGINT_BODY, MINOR_VALUE_NUMBER_BIGINT_LEN, MINOR_VALUE_NUMBER_DOUBLE, MINOR_VALUE_NUMBER_FLOAT, MINOR_VALUE_NUMBER_INT, MINOR_VALUE_NUMBER_LONG, MINOR_VALUE_STRING_LONG_ASCII, MINOR_VALUE_STRING_LONG_UNICODE, MINOR_VALUE_STRING_SHARED_2BYTE, MINOR_VALUE_STRING_SHORT_ASCII, MINOR_VALUE_STRING_SHORT_UNICODE
Fields inherited from class com.fasterxml.jackson.dataformat.smile.SmileParserBase
_binaryValue, _closed, _currInputProcessed, _formatFeatures, _inputEnd, _inputPtr, _ioContext, _mayContainRawBinary, _nameCopied, _nameCopyBuffer, _numberBigDecimal, _numberBigInt, _numberDouble, _numberFloat, _numberInt, _numberLong, _numberType, _numTypesValid, _quad1, _quad2, _quad3, _quadBuffer, _seenNameCount, _seenNames, _seenStringValueCount, _seenStringValues, _streamReadConstraints, _streamReadContext, _symbols, _symbolsCanonical, _textBuffer, _tokenOffsetForTotal, DEFAULT_NAME_BUFFER_LENGTH, DEFAULT_STRING_VALUE_BUFFER_LENGTH, LONGEST_NON_CHUNKED_BINARY, NO_STRINGS, SMILE_READ_CAPABILITIES
Fields inherited from class com.fasterxml.jackson.core.base.ParserMinimalBase
_currToken, _lastClearedToken, BD_MAX_INT, BD_MAX_LONG, BD_MIN_INT, BD_MIN_LONG, BI_MAX_INT, BI_MAX_LONG, BI_MIN_INT, BI_MIN_LONG, CHAR_NULL, INT_0, INT_9, INT_APOS, INT_ASTERISK, INT_BACKSLASH, INT_COLON, INT_COMMA, INT_CR, INT_e, INT_E, INT_HASH, INT_LBRACKET, INT_LCURLY, INT_LF, INT_MINUS, INT_PERIOD, INT_PLUS, INT_QUOTE, INT_RBRACKET, INT_RCURLY, INT_SLASH, INT_SPACE, INT_TAB, MAX_ERROR_TOKEN_LENGTH, MAX_INT_D, MAX_INT_L, MAX_LONG_D, MIN_INT_D, MIN_INT_L, MIN_LONG_D, NO_BYTES, NO_INTS, NR_BIGDECIMAL, NR_BIGINT, NR_DOUBLE, NR_FLOAT, NR_INT, NR_LONG, NR_UNKNOWN
Fields inherited from class com.fasterxml.jackson.core.JsonParser
_features, _requestPayload, DEFAULT_READ_CAPABILITIES
-
Constructor Summary
ConstructorsConstructorDescriptionNonBlockingByteArrayParser
(com.fasterxml.jackson.core.io.IOContext ctxt, int parserFeatures, int smileFeatures, com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer sym) -
Method Summary
Modifier and TypeMethodDescriptionprivate final boolean
protected final boolean
_decode7BitEncodedTail
(int bytesToDecode, int buffered) private final String
_decodeASCIIText
(byte[] inBuf, int inPtr, int len) private final String
_decodeLongUnicodeName
(byte[] inBuf, int inPtr, int len) private final String
_decodeShortUnicodeText
(byte[] inBuf, int inPtr, int len) Helper method used to decode short Unicode string, length for which actual length (in bytes) is knownprivate final int
_decodeUTF8_2
(int c, int d) private final int
_decodeUTF8_3
(int c, int d, int e) private final int
_decodeUTF8_4
(int c, int d, int e, int f) private final int
private final com.fasterxml.jackson.core.JsonToken
private final com.fasterxml.jackson.core.JsonToken
_finish7BitBinaryLen
(int value, int bytesRead) private final com.fasterxml.jackson.core.JsonToken
private final com.fasterxml.jackson.core.JsonToken
_finishBigDecimalLen
(int value, int bytesRead) private final com.fasterxml.jackson.core.JsonToken
_finishBigDecimalScale
(int value, int bytesRead) private final com.fasterxml.jackson.core.JsonToken
private final com.fasterxml.jackson.core.JsonToken
_finishBigIntLen
(int value, int bytesRead) protected final com.fasterxml.jackson.core.JsonToken
_finishDouble
(long value, int bytesRead) protected final com.fasterxml.jackson.core.JsonToken
_finishFloat
(int value, int bytesRead) protected com.fasterxml.jackson.core.JsonToken
_finishHeader
(int state) Helper method that will decode information from a header block that has been detected.private final com.fasterxml.jackson.core.JsonToken
_finishInt
(int value, int bytesRead) private final com.fasterxml.jackson.core.JsonToken
_finishLong
(long value, int bytesRead) private final com.fasterxml.jackson.core.JsonToken
private final com.fasterxml.jackson.core.JsonToken
_finishLongFieldName
(int outPtr) private final com.fasterxml.jackson.core.JsonToken
private final boolean
private final com.fasterxml.jackson.core.JsonToken
private final com.fasterxml.jackson.core.JsonToken
_finishRawBinaryLen
(int value, int bytesRead) protected final com.fasterxml.jackson.core.JsonToken
Method called when a (scalar) value type has been detected, but not all of contents have been decoded due to incomplete input available.private final int
_fourBytesToInt
(int ptr) private final com.fasterxml.jackson.core.JsonToken
private final com.fasterxml.jackson.core.JsonToken
private final com.fasterxml.jackson.core.JsonToken
protected final com.fasterxml.jackson.core.JsonToken
protected final com.fasterxml.jackson.core.JsonToken
_startFieldName
(int ch) Method that handles initial token type recognition for token that has to be either FIELD_NAME or END_OBJECT.protected final com.fasterxml.jackson.core.JsonToken
private final com.fasterxml.jackson.core.JsonToken
private final com.fasterxml.jackson.core.JsonToken
private final com.fasterxml.jackson.core.JsonToken
protected final com.fasterxml.jackson.core.JsonToken
protected final com.fasterxml.jackson.core.JsonToken
private final com.fasterxml.jackson.core.JsonToken
_startShortASCII
(int len) private final com.fasterxml.jackson.core.JsonToken
_startShortUnicode
(int len) private final com.fasterxml.jackson.core.JsonToken
_startValue
(int ch) Helper method called to detect type of a value token (at any level), and possibly decode it if contained in input buffer.void
void
feedInput
(byte[] buf, int start, int end) com.fasterxml.jackson.core.async.ByteArrayFeeder
final boolean
com.fasterxml.jackson.core.JsonToken
int
Methods inherited from class com.fasterxml.jackson.dataformat.smile.async.NonBlockingParserBase
_addDecodedToSymbols, _addSeenStringValue, _closeArrayScope, _closeInput, _closeObjectScope, _eofAsNextToken, _expandSeenNames, _findDecodedFromSymbols, _handleSharedName, _handleSharedString, _initByteArrayBuilder, _parseNumericValue, _releaseBuffers2, _reportInvalidInitial, _reportInvalidOther, _reportInvalidSharedName, _reportInvalidSharedStringValue, _reportMissingHeader, _startArrayScope, _startObjectScope, _valueComplete, canParseAsync, getBinaryValue, getCodec, getEmbeddedObject, getInputSource, getText, getText, getTextCharacters, getTextLength, getTextOffset, hasTextCharacters, readBinaryValue, setCodec, symbolTableForTests
Methods inherited from class com.fasterxml.jackson.dataformat.smile.SmileParserBase
_handleEOF, _releaseBuffers, _reportMismatchedEndMarker, _sourceReference, close, convertNumberToBigDecimal, convertNumberToBigInteger, convertNumberToDouble, convertNumberToFloat, convertNumberToInt, convertNumberToLong, currentLocation, currentName, currentTokenLocation, getBigIntegerValue, getCurrentLocation, getCurrentName, getDecimalValue, getDoubleValue, getFloatValue, getFormatFeatures, getIntValue, getLongValue, getNumberType, getNumberTypeFP, getNumberValue, getNumberValueExact, getParsingContext, getReadCapabilities, getTokenLocation, isClosed, isNaN, mayContainRawBinary, overrideCurrentName, overrideFormatFeatures, streamReadConstraints, version
Methods inherited from class com.fasterxml.jackson.core.base.ParserMinimalBase
_ascii, _asciiBytes, _constructError, _currentLocationMinusOne, _decodeBase64, _getCharDesc, _hasTextualNull, _longIntegerDesc, _longNumberDesc, _reportError, _reportError, _reportError, _reportInputCoercion, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportMissingRootWS, _reportUnexpectedChar, _reportUnexpectedNumberChar, _throwInternal, _throwInternalReturnAny, _throwInvalidSpace, _wrapError, clearCurrentToken, currentToken, currentTokenId, getCurrentToken, getCurrentTokenId, getLastClearedToken, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, getValueAsString, getValueAsString, hasCurrentToken, hasToken, hasTokenId, isExpectedNumberIntToken, isExpectedStartArrayToken, isExpectedStartObjectToken, nextValue, reportInvalidNumber, reportOverflowInt, reportOverflowInt, reportOverflowInt, reportOverflowLong, reportOverflowLong, reportOverflowLong, reportUnexpectedNumberChar, skipChildren
Methods inherited from class com.fasterxml.jackson.core.JsonParser
_codec, _constructError, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _reportUnsupportedOperation, assignCurrentValue, canReadObjectId, canReadTypeId, canUseSchema, configure, currentValue, disable, enable, finishToken, getBinaryValue, getBooleanValue, getByteValue, getCurrentValue, getFeatureMask, getNumberValueDeferred, getObjectId, getSchema, getShortValue, getTypeId, getValueAsBoolean, getValueAsDouble, isEnabled, isEnabled, nextBooleanValue, nextFieldName, nextFieldName, nextIntValue, nextLongValue, nextTextValue, overrideStdFeatures, readBinaryValue, readValueAs, readValueAs, readValueAsTree, readValuesAs, readValuesAs, releaseBuffered, requiresCustomCodec, setCurrentValue, setFeatureMask, setRequestPayloadOnError, setRequestPayloadOnError, setRequestPayloadOnError, setSchema
-
Field Details
-
_inputBuffer
protected byte[] _inputBufferThis buffer is actually provided viaNonBlockingInputFeeder
-
_origBufferLen
protected int _origBufferLenIn addition to current buffer pointer, and end pointer, we will also need to know number of bytes originally contained. This is needed to correctly update location information when the block has been completed.
-
-
Constructor Details
-
NonBlockingByteArrayParser
public NonBlockingByteArrayParser(com.fasterxml.jackson.core.io.IOContext ctxt, int parserFeatures, int smileFeatures, com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer sym)
-
-
Method Details
-
getNonBlockingInputFeeder
public com.fasterxml.jackson.core.async.ByteArrayFeeder getNonBlockingInputFeeder()- Overrides:
getNonBlockingInputFeeder
in classcom.fasterxml.jackson.core.JsonParser
-
needMoreInput
public final boolean needMoreInput()- Specified by:
needMoreInput
in interfacecom.fasterxml.jackson.core.async.NonBlockingInputFeeder
-
feedInput
- Specified by:
feedInput
in interfacecom.fasterxml.jackson.core.async.ByteArrayFeeder
- Throws:
IOException
-
endOfInput
public void endOfInput()- Specified by:
endOfInput
in interfacecom.fasterxml.jackson.core.async.NonBlockingInputFeeder
-
releaseBuffered
- Specified by:
releaseBuffered
in classNonBlockingParserBase
- Throws:
IOException
-
nextToken
- Specified by:
nextToken
in classcom.fasterxml.jackson.core.base.ParserMinimalBase
- Throws:
IOException
-
_finishToken
Method called when a (scalar) value type has been detected, but not all of contents have been decoded due to incomplete input available.- Throws:
IOException
-
_finishHeader
Helper method that will decode information from a header block that has been detected.- Throws:
IOException
-
_startValue
Helper method called to detect type of a value token (at any level), and possibly decode it if contained in input buffer. Note that possible header has been ruled out by caller and is not checked here.- Throws:
IOException
-
_startFieldName
Method that handles initial token type recognition for token that has to be either FIELD_NAME or END_OBJECT.- Throws:
IOException
-
_finishLongFieldName
private final com.fasterxml.jackson.core.JsonToken _finishLongFieldName(int outPtr) throws IOException - Throws:
IOException
-
_startShortASCII
- Throws:
IOException
-
_startShortUnicode
- Throws:
IOException
-
_startLongASCII
- Throws:
IOException
-
_finishLongASCII
- Throws:
IOException
-
_startLongUnicode
- Throws:
IOException
-
_finishLongUnicode
- Throws:
IOException
-
_finishPartialUnicodeChar
- Throws:
IOException
-
_decodeUTF8_2
- Throws:
IOException
-
_decodeUTF8_3
- Throws:
IOException
-
_decodeUTF8_4
- Throws:
IOException
-
_startInt
- Throws:
IOException
-
_finishInt
private final com.fasterxml.jackson.core.JsonToken _finishInt(int value, int bytesRead) throws IOException - Throws:
IOException
-
_startLong
- Throws:
IOException
-
_finishLong
private final com.fasterxml.jackson.core.JsonToken _finishLong(long value, int bytesRead) throws IOException - Throws:
IOException
-
_startBigInt
- Throws:
IOException
-
_finishBigIntLen
private final com.fasterxml.jackson.core.JsonToken _finishBigIntLen(int value, int bytesRead) throws IOException - Throws:
IOException
-
_finishBigIntBody
- Throws:
IOException
-
_startFloat
- Throws:
IOException
-
_finishFloat
protected final com.fasterxml.jackson.core.JsonToken _finishFloat(int value, int bytesRead) throws IOException - Throws:
IOException
-
_startDouble
- Throws:
IOException
-
_finishDouble
protected final com.fasterxml.jackson.core.JsonToken _finishDouble(long value, int bytesRead) throws IOException - Throws:
IOException
-
_startBigDecimal
- Throws:
IOException
-
_finishBigDecimalScale
private final com.fasterxml.jackson.core.JsonToken _finishBigDecimalScale(int value, int bytesRead) throws IOException - Throws:
IOException
-
_finishBigDecimalLen
private final com.fasterxml.jackson.core.JsonToken _finishBigDecimalLen(int value, int bytesRead) throws IOException - Throws:
IOException
-
_finishBigDecimalBody
- Throws:
IOException
-
_startRawBinary
- Throws:
IOException
-
_finishRawBinaryLen
private final com.fasterxml.jackson.core.JsonToken _finishRawBinaryLen(int value, int bytesRead) throws IOException - Throws:
IOException
-
_finishRawBinaryBody
- Throws:
IOException
-
_start7BitBinary
- Throws:
IOException
-
_finish7BitBinaryLen
private final com.fasterxml.jackson.core.JsonToken _finish7BitBinaryLen(int value, int bytesRead) throws IOException - Throws:
IOException
-
_finish7BitBinaryBody
- Throws:
IOException
-
_decodeASCIIText
- Throws:
IOException
-
_decodeShortUnicodeText
Helper method used to decode short Unicode string, length for which actual length (in bytes) is known- Parameters:
len
- Length between 1 and 64- Throws:
IOException
-
_decodeLongUnicodeName
- Throws:
IOException
-
_fourBytesToInt
- Throws:
IOException
-
_decodeVInt
- Throws:
IOException
-
_decode7BitEncoded
- Throws:
IOException
-
_decode7BitEncodedTail
- Throws:
IOException
-