Class DecoderOverAvroParser

java.lang.Object
org.apache.avro.io.Decoder
tools.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
    Description
    protected final AvroParserImpl
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
     
    protected tools.jackson.core.JsonToken
    consumeToken(tools.jackson.core.JsonToken... expectedTokens)
    Reads in the next value token from the parser and validates that it's one of the expected tokens
    long
     
    protected tools.jackson.core.JsonToken
    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.
    protected tools.jackson.core.JsonToken
    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
    long
     
    boolean
     
     
    double
     
    int
     
    void
    readFixed(byte[] bytes, int start, int length)
     
    float
     
    int
     
    int
     
    long
     
    long
     
    void
     
     
    org.apache.avro.util.Utf8
    readString(org.apache.avro.util.Utf8 old)
     
    long
     
    void
     
    void
    skipFixed(int length)
     
    long
     
    void
     

    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 Details

  • Constructor Details

    • DecoderOverAvroParser

      public DecoderOverAvroParser(AvroParserImpl parser)
  • Method Details

    • consumeToken

      protected tools.jackson.core.JsonToken consumeToken(tools.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 tools.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 tools.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