Class NonBlockingByteArrayParser
java.lang.Object
tools.jackson.core.JsonParser
tools.jackson.core.base.ParserMinimalBase
tools.jackson.dataformat.smile.SmileParserBase
tools.jackson.dataformat.smile.async.NonBlockingParserBase
tools.jackson.dataformat.smile.async.NonBlockingByteArrayParser
- All Implemented Interfaces:
Closeable, AutoCloseable, tools.jackson.core.async.ByteArrayFeeder, tools.jackson.core.async.NonBlockingInputFeeder, tools.jackson.core.Versioned
public class NonBlockingByteArrayParser
extends NonBlockingParserBase
implements tools.jackson.core.async.ByteArrayFeeder
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.core.JsonParser
tools.jackson.core.JsonParser.NumberType, tools.jackson.core.JsonParser.NumberTypeFP -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]This buffer is actually provided viaNonBlockingInputFeederprotected intIn addition to current buffer pointer, and end pointer, we will also need to know number of bytes originally contained.Fields inherited from class 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_HEADER_INITIAL, MINOR_HEADER_INLINE, MINOR_PROPERTY_NAME_2BYTE, MINOR_PROPERTY_NAME_LONG, MINOR_PROPERTY_NAME_SHORT_ASCII, MINOR_PROPERTY_NAME_SHORT_UNICODE, 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_UNICODEFields inherited from class SmileParserBase
_binaryValue, _currInputProcessed, _formatFeatures, _inputEnd, _inputPtr, _mayContainRawBinary, _numberBigDecimal, _numberBigInt, _numberDouble, _numberFloat, _numberInt, _numberLong, _numberType, _numTypesValid, _quad1, _quad2, _quad3, _quadBuffer, _seenNameCount, _seenNames, _seenStringValueCount, _seenStringValues, _streamReadContext, _symbols, _symbolsCanonical, _textBuffer, _tokenOffsetForTotal, DEFAULT_NAME_BUFFER_LENGTH, DEFAULT_STRING_VALUE_BUFFER_LENGTH, LONGEST_NON_CHUNKED_BINARY, NO_STRINGS, SMILE_READ_CAPABILITIESFields inherited from class tools.jackson.core.base.ParserMinimalBase
_closed, _currToken, _ioContext, _lastClearedToken, _objectReadContext, _streamReadConstraints, _streamReadFeatures, _tokenCount, _trackMaxTokenCount, 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_RS, INT_SLASH, INT_SPACE, INT_TAB, MAX_BYTE_I, MAX_INT_D, MAX_INT_L, MAX_LONG_D, MAX_SHORT_I, MIN_BYTE_I, MIN_INT_D, MIN_INT_L, MIN_LONG_D, MIN_SHORT_I, NO_BYTES, NO_INTS, NR_BIGDECIMAL, NR_BIGINT, NR_DOUBLE, NR_FLOAT, NR_INT, NR_LONG, NR_UNKNOWN, STREAM_READ_FEATURE_DEFAULTSFields inherited from class tools.jackson.core.JsonParser
DEFAULT_READ_CAPABILITIES -
Constructor Summary
ConstructorsConstructorDescriptionNonBlockingByteArrayParser(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ioCtxt, int parserFeatures, int smileFeatures, tools.jackson.core.sym.ByteQuadsCanonicalizer sym) -
Method Summary
Modifier and TypeMethodDescriptionprivate final booleanprotected 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 intprivate final tools.jackson.core.JsonTokenprivate final tools.jackson.core.JsonToken_finish7BitBinaryLen(int value, int bytesRead) private final tools.jackson.core.JsonTokenprivate final tools.jackson.core.JsonToken_finishBigDecimalLen(int value, int bytesRead) private final tools.jackson.core.JsonToken_finishBigDecimalScale(int value, int bytesRead) private final tools.jackson.core.JsonTokenprivate final tools.jackson.core.JsonToken_finishBigIntLen(int value, int bytesRead) protected final tools.jackson.core.JsonToken_finishDouble(long value, int bytesRead) protected final tools.jackson.core.JsonToken_finishFloat(int value, int bytesRead) protected tools.jackson.core.JsonToken_finishHeader(int state) Helper method that will decode information from a header block that has been detected.private final tools.jackson.core.JsonToken_finishInt(int value, int bytesRead) private final tools.jackson.core.JsonToken_finishLong(long value, int bytesRead) private final tools.jackson.core.JsonTokenprivate final tools.jackson.core.JsonToken_finishLongFieldName(int outPtr) private final tools.jackson.core.JsonTokenprivate final booleanprivate final tools.jackson.core.JsonTokenprivate final tools.jackson.core.JsonToken_finishRawBinaryLen(int value, int bytesRead) protected final tools.jackson.core.JsonTokenMethod 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 tools.jackson.core.JsonTokenprivate final tools.jackson.core.JsonTokenprivate final tools.jackson.core.JsonTokenprotected final tools.jackson.core.JsonTokenprotected final tools.jackson.core.JsonToken_startFieldName(int ch) Method that handles initial token type recognition for token that has to be either PROPERTY_NAME or END_OBJECT.protected final tools.jackson.core.JsonTokenprivate final tools.jackson.core.JsonTokenprivate final tools.jackson.core.JsonTokenprivate final tools.jackson.core.JsonTokenprotected final tools.jackson.core.JsonTokenprotected final tools.jackson.core.JsonTokenprivate final tools.jackson.core.JsonToken_startShortASCII(int len) private final tools.jackson.core.JsonToken_startShortUnicode(int len) private final tools.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.voidvoidfeedInput(byte[] buf, int start, int end) final booleantools.jackson.core.JsonTokentools.jackson.core.async.ByteArrayFeederintMethods inherited from class NonBlockingParserBase
_addDecodedToSymbols, _addSeenStringValue, _closeArrayScope, _closeInput, _closeObjectScope, _eofAsNextToken, _expandSeenNames, _findDecodedFromSymbols, _handleSharedName, _handleSharedString, _initByteArrayBuilder, _parseNumericValue, _parseNumericValueIfNumber, _releaseBuffers2, _reportInvalidInitial, _reportInvalidOther, _reportInvalidSharedName, _reportInvalidSharedStringValue, _reportMissingHeader, _startArrayScope, _startObjectScope, _valueComplete, canParseAsync, getBinaryValue, getEmbeddedObject, getString, getString, getStringCharacters, getStringLength, getStringOffset, hasStringCharacters, readBinaryValue, streamReadInputSource, symbolTableForTestsMethods inherited from class SmileParserBase
_handleEOF, _releaseBuffers, _reportMismatchedEndMarker, _sourceReference, assignCurrentValue, close, convertNumberToBigDecimal, convertNumberToBigInteger, convertNumberToDouble, convertNumberToFloat, convertNumberToInt, convertNumberToLong, currentLocation, currentName, currentTokenLocation, currentValue, getBigIntegerValue, getDecimalValue, getDoubleValue, getFloatValue, getIntValue, getLongValue, getNumberType, getNumberTypeFP, getNumberValue, getNumberValueExact, isClosed, isNaN, mayContainRawBinary, streamReadCapabilities, streamReadContext, versionMethods inherited from class tools.jackson.core.base.ParserMinimalBase
_constructInputCoercion, _constructNotNumericType, _currentLocationMinusOne, _decodeBase64, _getCharDesc, _hasTextualNull, _longIntegerDesc, _longNumberDesc, _nullSafeUpdateToken, _reportBadInputStream, _reportBadReader, _reportError, _reportError, _reportError, _reportError, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportInvalidNumber, _reportInvalidSpace, _reportInvalidUTF8Surrogate, _reportMissingRootWS, _reportOverflowByte, _reportOverflowInt, _reportOverflowInt, _reportOverflowInt, _reportOverflowLong, _reportOverflowLong, _reportOverflowLong, _reportOverflowShort, _reportUnexpectedChar, _reportUnexpectedNumberChar, _throwInternal, _updateToken, _updateTokenToNA, _updateTokenToNull, _wrapIOFailure, clearCurrentToken, currentNameMatch, currentToken, currentTokenCount, currentTokenId, finishToken, getBooleanValue, getByteValue, getLastClearedToken, getNumberValueDeferred, getShortValue, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, getValueAsString, getValueAsString, hasCurrentToken, hasToken, hasTokenId, isEnabled, isExpectedNumberIntToken, isExpectedStartArrayToken, isExpectedStartObjectToken, nextName, nextName, nextNameMatch, nextValue, objectReadContext, readValueAs, readValueAs, readValueAs, readValueAsTree, skipChildren, streamReadConstraints, streamReadFeaturesMethods inherited from class tools.jackson.core.JsonParser
_constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _reportUnsupportedOperation, canReadObjectId, canReadTypeId, getBinaryValue, getObjectId, getSchema, getText, getTextCharacters, getTextLength, getTextOffset, getTypeId, getValueAsBoolean, getValueAsDouble, nextBooleanValue, nextIntValue, nextLongValue, nextStringValue, readBinaryValue, readString, releaseBuffered
-
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(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ioCtxt, int parserFeatures, int smileFeatures, tools.jackson.core.sym.ByteQuadsCanonicalizer sym)
-
-
Method Details
-
nonBlockingInputFeeder
public tools.jackson.core.async.ByteArrayFeeder nonBlockingInputFeeder()- Overrides:
nonBlockingInputFeederin classtools.jackson.core.JsonParser
-
needMoreInput
public final boolean needMoreInput()- Specified by:
needMoreInputin interfacetools.jackson.core.async.NonBlockingInputFeeder
-
feedInput
public void feedInput(byte[] buf, int start, int end) throws tools.jackson.core.JacksonException - Specified by:
feedInputin interfacetools.jackson.core.async.ByteArrayFeeder- Throws:
tools.jackson.core.JacksonException
-
endOfInput
public void endOfInput()- Specified by:
endOfInputin interfacetools.jackson.core.async.NonBlockingInputFeeder
-
releaseBuffered
- Specified by:
releaseBufferedin classNonBlockingParserBase- Throws:
tools.jackson.core.JacksonException
-
nextToken
public tools.jackson.core.JsonToken nextToken() throws tools.jackson.core.JacksonException- Specified by:
nextTokenin classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
_finishToken
protected final tools.jackson.core.JsonToken _finishToken() throws tools.jackson.core.JacksonExceptionMethod called when a (scalar) value type has been detected, but not all of contents have been decoded due to incomplete input available.- Throws:
tools.jackson.core.JacksonException
-
_finishHeader
protected tools.jackson.core.JsonToken _finishHeader(int state) throws tools.jackson.core.JacksonException Helper method that will decode information from a header block that has been detected.- Throws:
tools.jackson.core.JacksonException
-
_startValue
private final tools.jackson.core.JsonToken _startValue(int ch) throws tools.jackson.core.JacksonException 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:
tools.jackson.core.JacksonException
-
_startFieldName
protected final tools.jackson.core.JsonToken _startFieldName(int ch) throws tools.jackson.core.JacksonException Method that handles initial token type recognition for token that has to be either PROPERTY_NAME or END_OBJECT.- Throws:
tools.jackson.core.JacksonException
-
_finishLongFieldName
private final tools.jackson.core.JsonToken _finishLongFieldName(int outPtr) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_startShortASCII
private final tools.jackson.core.JsonToken _startShortASCII(int len) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_startShortUnicode
private final tools.jackson.core.JsonToken _startShortUnicode(int len) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_startLongASCII
private final tools.jackson.core.JsonToken _startLongASCII() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_finishLongASCII
private final tools.jackson.core.JsonToken _finishLongASCII() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_startLongUnicode
protected final tools.jackson.core.JsonToken _startLongUnicode() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_finishLongUnicode
private final tools.jackson.core.JsonToken _finishLongUnicode() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_finishPartialUnicodeChar
private final boolean _finishPartialUnicodeChar() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_decodeUTF8_2
private final int _decodeUTF8_2(int c, int d) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_decodeUTF8_3
private final int _decodeUTF8_3(int c, int d, int e) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_decodeUTF8_4
private final int _decodeUTF8_4(int c, int d, int e, int f) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_startInt
private final tools.jackson.core.JsonToken _startInt() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_finishInt
private final tools.jackson.core.JsonToken _finishInt(int value, int bytesRead) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_startLong
private final tools.jackson.core.JsonToken _startLong() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_finishLong
private final tools.jackson.core.JsonToken _finishLong(long value, int bytesRead) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_startBigInt
private final tools.jackson.core.JsonToken _startBigInt() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_finishBigIntLen
private final tools.jackson.core.JsonToken _finishBigIntLen(int value, int bytesRead) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_finishBigIntBody
private final tools.jackson.core.JsonToken _finishBigIntBody() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_startFloat
protected final tools.jackson.core.JsonToken _startFloat() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_finishFloat
protected final tools.jackson.core.JsonToken _finishFloat(int value, int bytesRead) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_startDouble
protected final tools.jackson.core.JsonToken _startDouble() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_finishDouble
protected final tools.jackson.core.JsonToken _finishDouble(long value, int bytesRead) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_startBigDecimal
private final tools.jackson.core.JsonToken _startBigDecimal() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_finishBigDecimalScale
private final tools.jackson.core.JsonToken _finishBigDecimalScale(int value, int bytesRead) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_finishBigDecimalLen
private final tools.jackson.core.JsonToken _finishBigDecimalLen(int value, int bytesRead) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_finishBigDecimalBody
private final tools.jackson.core.JsonToken _finishBigDecimalBody() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_startRawBinary
protected final tools.jackson.core.JsonToken _startRawBinary() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_finishRawBinaryLen
private final tools.jackson.core.JsonToken _finishRawBinaryLen(int value, int bytesRead) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_finishRawBinaryBody
private final tools.jackson.core.JsonToken _finishRawBinaryBody() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_start7BitBinary
private final tools.jackson.core.JsonToken _start7BitBinary() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_finish7BitBinaryLen
private final tools.jackson.core.JsonToken _finish7BitBinaryLen(int value, int bytesRead) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_finish7BitBinaryBody
private final tools.jackson.core.JsonToken _finish7BitBinaryBody() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_decodeASCIIText
private final String _decodeASCIIText(byte[] inBuf, int inPtr, int len) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_decodeShortUnicodeText
private final String _decodeShortUnicodeText(byte[] inBuf, int inPtr, int len) throws tools.jackson.core.JacksonException 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:
tools.jackson.core.JacksonException
-
_decodeLongUnicodeName
private final String _decodeLongUnicodeName(byte[] inBuf, int inPtr, int len) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_fourBytesToInt
private final int _fourBytesToInt(int ptr) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_decodeVInt
private final int _decodeVInt() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_decode7BitEncoded
private final boolean _decode7BitEncoded() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_decode7BitEncodedTail
protected final boolean _decode7BitEncodedTail(int bytesToDecode, int buffered) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-