com.fasterxml.jackson.dataformat.avro.apacheimpl

## Class DecoderOverAvroParser

- java.lang.Object
- - org.apache.avro.io.Decoder
  - - com.fasterxml.jackson.dataformat.avro.apacheimpl.DecoderOverAvroParser

-     public class DecoderOverAvroParser
      extends org.apache.avro.io.Decoder

  Wraps an AvroParser instance and allows it to be advanced by reading from it like an avro `Decoder`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected AvroParserImpl` | `_parser`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DecoderOverAvroParser(AvroParserImpl parser)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `arrayNext()`
    `protected com.fasterxml.jackson.core.JsonToken` | `consumeToken(com.fasterxml.jackson.core.JsonToken... expectedTokens)` Reads in the next value token from the parser and validates that it's one of the expected tokens
    `long` | `mapNext()`
    `protected com.fasterxml.jackson.core.JsonToken` | `nextUnionValue()` Advance to the next token that might contain union branching information; This effectively discards the virtual JSON tokens inserted by the parser for `END_OBJECT`, `START_ARRAY`, etc.
    `protected com.fasterxml.jackson.core.JsonToken` | `nextValue()` Advance to the next actual value token; This effectively discards the virtual JSON tokens inserted by the parser for `START_OBJECT`, `END_OBJECT`, `START_ARRAY`, etc.
    `long` | `readArrayStart()`
    `boolean` | `readBoolean()`
    `ByteBuffer` | `readBytes(ByteBuffer old)`
    `double` | `readDouble()`
    `int` | `readEnum()`
    `void` | `readFixed(byte[] bytes, int start, int length)`
    `float` | `readFloat()`
    `int` | `readIndex()`
    `int` | `readInt()`
    `long` | `readLong()`
    `long` | `readMapStart()`
    `void` | `readNull()`
    `String` | `readString()`
    `org.apache.avro.util.Utf8` | `readString(org.apache.avro.util.Utf8 old)`
    `long` | `skipArray()`
    `void` | `skipBytes()`
    `void` | `skipFixed(int length)`
    `long` | `skipMap()`
    `void` | `skipString()`

    - ### Methods inherited from class org.apache.avro.io.Decoder

      `readFixed`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### _parser

          protected final AvroParserImpl _parser

  - ### Constructor Detail

    - #### DecoderOverAvroParser

          public DecoderOverAvroParser(AvroParserImpl parser)

  - ### Method Detail

    - #### consumeToken

          protected com.fasterxml.jackson.core.JsonToken consumeToken(com.fasterxml.jackson.core.JsonToken... expectedTokens)
                                                               throws IOException

      Reads in the next value token from the parser and validates that it's one of the expected tokens
      Parameters:
        `expectedTokens` - List of token types that is expected
      Returns:
        The token that was consumed from the parser
      Throws:
        `IOException` - If there is an error while reading the next token
        `IllegalArgumentException` - If the next token is not one of the `expectedTokens`

    - #### nextValue

          protected com.fasterxml.jackson.core.JsonToken nextValue()
                                                            throws IOException

      Advance to the next actual value token; This effectively discards the virtual JSON tokens inserted by the parser for `START_OBJECT`, `END_OBJECT`, `START_ARRAY`, etc. that are not actually present in the underlying data stream and stops after reading the first token that represents actual data
      Returns:
        The next data token
      Throws:
        `IOException` - If there is an error while reading the next token

    - #### nextUnionValue

          protected com.fasterxml.jackson.core.JsonToken nextUnionValue()
                                                                 throws IOException

      Advance to the next token that might contain union branching information; This effectively discards the virtual JSON tokens inserted by the parser for `END_OBJECT`, `START_ARRAY`, etc. that are not actually present in the underlying data stream and stops after reading the first token that represents actual data. `START_OBJECT` is not skipped because union information is only available at the start of an object, and has been discarded by the parser by the time we reach the next actual value.
      Returns:
        The next union branch token
      Throws:
        `IOException` - If there is an error while reading the next token

    - #### readNull

          public void readNull()
                        throws IOException

      Specified by:
        `readNull` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### readBoolean

          public boolean readBoolean()
                              throws IOException

      Specified by:
        `readBoolean` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### readInt

          public int readInt()
                      throws IOException

      Specified by:
        `readInt` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### readLong

          public long readLong()
                        throws IOException

      Specified by:
        `readLong` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### readFloat

          public float readFloat()
                          throws IOException

      Specified by:
        `readFloat` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### readDouble

          public double readDouble()
                            throws IOException

      Specified by:
        `readDouble` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### readString

          public org.apache.avro.util.Utf8 readString(org.apache.avro.util.Utf8 old)
                                               throws IOException

      Specified by:
        `readString` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### readString

          public String readString()
                            throws IOException

      Specified by:
        `readString` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### skipString

          public void skipString()
                          throws IOException

      Specified by:
        `skipString` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### readBytes

          public ByteBuffer readBytes(ByteBuffer old)
                               throws IOException

      Specified by:
        `readBytes` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### skipBytes

          public void skipBytes()
                         throws IOException

      Specified by:
        `skipBytes` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### readFixed

          public void readFixed(byte[] bytes,
                       int start,
                       int length)
                         throws IOException

      Specified by:
        `readFixed` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### skipFixed

          public void skipFixed(int length)
                         throws IOException

      Specified by:
        `skipFixed` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### readEnum

          public int readEnum()
                       throws IOException

      Specified by:
        `readEnum` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### readArrayStart

          public long readArrayStart()
                              throws IOException

      Specified by:
        `readArrayStart` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### arrayNext

          public long arrayNext()
                         throws IOException

      Specified by:
        `arrayNext` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### skipArray

          public long skipArray()
                         throws IOException

      Specified by:
        `skipArray` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### readMapStart

          public long readMapStart()
                            throws IOException

      Specified by:
        `readMapStart` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### mapNext

          public long mapNext()
                       throws IOException

      Specified by:
        `mapNext` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### skipMap

          public long skipMap()
                       throws IOException

      Specified by:
        `skipMap` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

    - #### readIndex

          public int readIndex()
                        throws IOException

      Specified by:
        `readIndex` in class `org.apache.avro.io.Decoder`
      Throws:
        `IOException`

Copyright © 2017 FasterXML. All rights reserved.