Class NonBlockingByteBufferJsonParser
- java.lang.Object
 - 
- com.fasterxml.jackson.core.JsonParser
 - 
- com.fasterxml.jackson.core.base.ParserMinimalBase
 - 
- com.fasterxml.jackson.core.base.ParserBase
 - 
- com.fasterxml.jackson.core.json.JsonParserBase
 - 
- com.fasterxml.jackson.core.json.async.NonBlockingJsonParserBase
 - 
- com.fasterxml.jackson.core.json.async.NonBlockingUtf8JsonParserBase
 - 
- com.fasterxml.jackson.core.json.async.NonBlockingByteBufferJsonParser
 
 
 
 
 
 
 
 
- 
- All Implemented Interfaces:
 ByteBufferFeeder,NonBlockingInputFeeder,Versioned,java.io.Closeable,java.lang.AutoCloseable
public class NonBlockingByteBufferJsonParser extends NonBlockingUtf8JsonParserBase implements ByteBufferFeeder
Non-blocking parser implementation for JSON content that takes its input viaByteBufferinstance(s) passed.NOTE: only supports parsing of UTF-8 encoded content (and 7-bit US-ASCII since it is strict subset of UTF-8): other encodings are not supported.
- Since:
 - 2.14
 
 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from class com.fasterxml.jackson.core.JsonParser
JsonParser.Feature, JsonParser.NumberType, JsonParser.NumberTypeFP 
 - 
 
- 
Constructor Summary
Constructors Constructor Description NonBlockingByteBufferJsonParser(IOContext ctxt, int parserFeatures, ByteQuadsCanonicalizer sym) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfeedInput(java.nio.ByteBuffer byteBuffer)Method that can be called to feed more data, if (and only if)NonBlockingInputFeeder.needMoreInput()returns true.NonBlockingInputFeedergetNonBlockingInputFeeder()Method that will either return a feeder instance (if parser uses non-blocking, aka asynchronous access); ornullfor parsers that use blocking I/O.intreleaseBuffered(java.io.OutputStream out)Method that can be called to push back any content that has been read but not consumed by the parser.- 
Methods inherited from class com.fasterxml.jackson.core.json.async.NonBlockingUtf8JsonParserBase
endOfInput, needMoreInput, nextToken 
- 
Methods inherited from class com.fasterxml.jackson.core.json.async.NonBlockingJsonParserBase
canParseAsync, currentLocation, currentTokenLocation, getBinaryValue, getEmbeddedObject, getInputSource, getText, getText, getTextCharacters, getTextLength, getTextOffset, getValueAsString, getValueAsString, hasTextCharacters, readBinaryValue, setCodec 
- 
Methods inherited from class com.fasterxml.jackson.core.json.JsonParserBase
getCodec, getCurrentLocation, getNumberTypeFP, getReadCapabilities, getTokenLocation 
- 
Methods inherited from class com.fasterxml.jackson.core.base.ParserBase
_getByteArrayBuilder, assignCurrentValue, close, currentValue, disable, enable, getBigIntegerValue, getCurrentName, getDecimalValue, getDoubleValue, getFloatValue, getIntValue, getLongValue, getNumberType, getNumberValue, getNumberValueDeferred, getNumberValueExact, getParsingContext, getTokenCharacterOffset, getTokenColumnNr, getTokenLineNr, isClosed, isNaN, overrideCurrentName, overrideStdFeatures, setFeatureMask, streamReadConstraints, version 
- 
Methods inherited from class com.fasterxml.jackson.core.base.ParserMinimalBase
clearCurrentToken, currentToken, currentTokenId, getCurrentToken, getCurrentTokenId, getLastClearedToken, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, hasCurrentToken, hasToken, hasTokenId, isExpectedNumberIntToken, isExpectedStartArrayToken, isExpectedStartObjectToken, nextValue, skipChildren 
- 
Methods inherited from class com.fasterxml.jackson.core.JsonParser
canReadObjectId, canReadTypeId, canUseSchema, configure, currentName, finishToken, getBinaryValue, getBooleanValue, getByteValue, getCurrentValue, getFeatureMask, getFormatFeatures, getObjectId, getSchema, getShortValue, getTypeId, getValueAsBoolean, getValueAsDouble, isEnabled, isEnabled, nextBooleanValue, nextFieldName, nextFieldName, nextIntValue, nextLongValue, nextTextValue, overrideFormatFeatures, readBinaryValue, readValueAs, readValueAs, readValueAsTree, readValuesAs, readValuesAs, releaseBuffered, requiresCustomCodec, setCurrentValue, setRequestPayloadOnError, setRequestPayloadOnError, setRequestPayloadOnError, setSchema 
- 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface com.fasterxml.jackson.core.async.NonBlockingInputFeeder
endOfInput, needMoreInput 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
NonBlockingByteBufferJsonParser
public NonBlockingByteBufferJsonParser(IOContext ctxt, int parserFeatures, ByteQuadsCanonicalizer sym)
 
 - 
 
- 
Method Detail
- 
getNonBlockingInputFeeder
public NonBlockingInputFeeder getNonBlockingInputFeeder()
Description copied from class:JsonParserMethod that will either return a feeder instance (if parser uses non-blocking, aka asynchronous access); ornullfor parsers that use blocking I/O.- Overrides:
 getNonBlockingInputFeederin classJsonParser- Returns:
 - Input feeder to use with non-blocking (async) parsing
 
 
- 
feedInput
public void feedInput(java.nio.ByteBuffer byteBuffer) throws java.io.IOExceptionDescription copied from interface:ByteBufferFeederMethod that can be called to feed more data, if (and only if)NonBlockingInputFeeder.needMoreInput()returns true.- Specified by:
 feedInputin interfaceByteBufferFeeder- Parameters:
 byteBuffer- Buffer that contains additional input to read- Throws:
 java.io.IOException- if the state is such that this method should not be called (has not yet consumed existing input data, or has been marked as closed)
 
- 
releaseBuffered
public int releaseBuffered(java.io.OutputStream out) throws java.io.IOExceptionDescription copied from class:JsonParserMethod that can be called to push back any content that has been read but not consumed by the parser. This is usually done after reading all content of interest using parser. Content is released by writing it to given stream if possible; if underlying input is byte-based it can released, if not (char-based) it can not.- Specified by:
 releaseBufferedin classNonBlockingJsonParserBase- Parameters:
 out- OutputStream to which buffered, undecoded content is written to- Returns:
 - -1 if the underlying content source is not byte based
    (that is, input can not be sent to 
OutputStream; otherwise number of bytes released (0 if there was nothing to release) - Throws:
 java.io.IOException- if write to stream threw exception
 
 - 
 
 -