Class NonBlockingByteArrayParser

java.lang.Object
com.fasterxml.jackson.core.JsonParser
com.fasterxml.jackson.core.base.ParserMinimalBase
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
  • Field Details

    • _inputBuffer

      protected byte[] _inputBuffer
      This buffer is actually provided via NonBlockingInputFeeder
    • _origBufferLen

      protected int _origBufferLen
      In 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 class com.fasterxml.jackson.core.JsonParser
    • needMoreInput

      public final boolean needMoreInput()
      Specified by:
      needMoreInput in interface com.fasterxml.jackson.core.async.NonBlockingInputFeeder
    • feedInput

      public void feedInput(byte[] buf, int start, int end) throws IOException
      Specified by:
      feedInput in interface com.fasterxml.jackson.core.async.ByteArrayFeeder
      Throws:
      IOException
    • endOfInput

      public void endOfInput()
      Specified by:
      endOfInput in interface com.fasterxml.jackson.core.async.NonBlockingInputFeeder
    • releaseBuffered

      public int releaseBuffered(OutputStream out) throws IOException
      Specified by:
      releaseBuffered in class NonBlockingParserBase
      Throws:
      IOException
    • nextToken

      public com.fasterxml.jackson.core.JsonToken nextToken() throws IOException
      Specified by:
      nextToken in class com.fasterxml.jackson.core.base.ParserMinimalBase
      Throws:
      IOException
    • _finishToken

      protected final com.fasterxml.jackson.core.JsonToken _finishToken() throws IOException
      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

      protected com.fasterxml.jackson.core.JsonToken _finishHeader(int state) throws IOException
      Helper method that will decode information from a header block that has been detected.
      Throws:
      IOException
    • _startValue

      private final com.fasterxml.jackson.core.JsonToken _startValue(int ch) throws IOException
      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

      protected final com.fasterxml.jackson.core.JsonToken _startFieldName(int ch) throws IOException
      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

      private final com.fasterxml.jackson.core.JsonToken _startShortASCII(int len) throws IOException
      Throws:
      IOException
    • _startShortUnicode

      private final com.fasterxml.jackson.core.JsonToken _startShortUnicode(int len) throws IOException
      Throws:
      IOException
    • _startLongASCII

      private final com.fasterxml.jackson.core.JsonToken _startLongASCII() throws IOException
      Throws:
      IOException
    • _finishLongASCII

      private final com.fasterxml.jackson.core.JsonToken _finishLongASCII() throws IOException
      Throws:
      IOException
    • _startLongUnicode

      protected final com.fasterxml.jackson.core.JsonToken _startLongUnicode() throws IOException
      Throws:
      IOException
    • _finishLongUnicode

      private final com.fasterxml.jackson.core.JsonToken _finishLongUnicode() throws IOException
      Throws:
      IOException
    • _finishPartialUnicodeChar

      private final boolean _finishPartialUnicodeChar() throws IOException
      Throws:
      IOException
    • _decodeUTF8_2

      private final int _decodeUTF8_2(int c, int d) throws IOException
      Throws:
      IOException
    • _decodeUTF8_3

      private final int _decodeUTF8_3(int c, int d, int e) throws IOException
      Throws:
      IOException
    • _decodeUTF8_4

      private final int _decodeUTF8_4(int c, int d, int e, int f) throws IOException
      Throws:
      IOException
    • _startInt

      private final com.fasterxml.jackson.core.JsonToken _startInt() throws IOException
      Throws:
      IOException
    • _finishInt

      private final com.fasterxml.jackson.core.JsonToken _finishInt(int value, int bytesRead) throws IOException
      Throws:
      IOException
    • _startLong

      private final com.fasterxml.jackson.core.JsonToken _startLong() throws IOException
      Throws:
      IOException
    • _finishLong

      private final com.fasterxml.jackson.core.JsonToken _finishLong(long value, int bytesRead) throws IOException
      Throws:
      IOException
    • _startBigInt

      private final com.fasterxml.jackson.core.JsonToken _startBigInt() throws IOException
      Throws:
      IOException
    • _finishBigIntLen

      private final com.fasterxml.jackson.core.JsonToken _finishBigIntLen(int value, int bytesRead) throws IOException
      Throws:
      IOException
    • _finishBigIntBody

      private final com.fasterxml.jackson.core.JsonToken _finishBigIntBody() throws IOException
      Throws:
      IOException
    • _startFloat

      protected final com.fasterxml.jackson.core.JsonToken _startFloat() throws IOException
      Throws:
      IOException
    • _finishFloat

      protected final com.fasterxml.jackson.core.JsonToken _finishFloat(int value, int bytesRead) throws IOException
      Throws:
      IOException
    • _startDouble

      protected final com.fasterxml.jackson.core.JsonToken _startDouble() throws IOException
      Throws:
      IOException
    • _finishDouble

      protected final com.fasterxml.jackson.core.JsonToken _finishDouble(long value, int bytesRead) throws IOException
      Throws:
      IOException
    • _startBigDecimal

      private final com.fasterxml.jackson.core.JsonToken _startBigDecimal() throws IOException
      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

      private final com.fasterxml.jackson.core.JsonToken _finishBigDecimalBody() throws IOException
      Throws:
      IOException
    • _startRawBinary

      protected final com.fasterxml.jackson.core.JsonToken _startRawBinary() throws IOException
      Throws:
      IOException
    • _finishRawBinaryLen

      private final com.fasterxml.jackson.core.JsonToken _finishRawBinaryLen(int value, int bytesRead) throws IOException
      Throws:
      IOException
    • _finishRawBinaryBody

      private final com.fasterxml.jackson.core.JsonToken _finishRawBinaryBody() throws IOException
      Throws:
      IOException
    • _start7BitBinary

      private final com.fasterxml.jackson.core.JsonToken _start7BitBinary() throws IOException
      Throws:
      IOException
    • _finish7BitBinaryLen

      private final com.fasterxml.jackson.core.JsonToken _finish7BitBinaryLen(int value, int bytesRead) throws IOException
      Throws:
      IOException
    • _finish7BitBinaryBody

      private final com.fasterxml.jackson.core.JsonToken _finish7BitBinaryBody() throws IOException
      Throws:
      IOException
    • _decodeASCIIText

      private final String _decodeASCIIText(byte[] inBuf, int inPtr, int len) throws IOException
      Throws:
      IOException
    • _decodeShortUnicodeText

      private final String _decodeShortUnicodeText(byte[] inBuf, int inPtr, int len) throws IOException
      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

      private final String _decodeLongUnicodeName(byte[] inBuf, int inPtr, int len) throws IOException
      Throws:
      IOException
    • _fourBytesToInt

      private final int _fourBytesToInt(int ptr) throws IOException
      Throws:
      IOException
    • _decodeVInt

      private final int _decodeVInt() throws IOException
      Throws:
      IOException
    • _decode7BitEncoded

      private final boolean _decode7BitEncoded() throws IOException
      Throws:
      IOException
    • _decode7BitEncodedTail

      protected final boolean _decode7BitEncodedTail(int bytesToDecode, int buffered) throws IOException
      Throws:
      IOException