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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongprotected tools.jackson.core.JsonTokenconsumeToken(tools.jackson.core.JsonToken... expectedTokens) Reads in the next value token from the parser and validates that it's one of the expected tokenslongmapNext()protected tools.jackson.core.JsonTokenAdvance to the next token that might contain union branching information; This effectively discards the virtual JSON tokens inserted by the parser forEND_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.JsonTokenAdvance to the next actual value token; This effectively discards the virtual JSON tokens inserted by the parser forSTART_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 datalongbooleanreadBytes(ByteBuffer old) doubleintreadEnum()voidreadFixed(byte[] bytes, int start, int length) floatintintreadInt()longreadLong()longvoidreadNull()org.apache.avro.util.Utf8readString(org.apache.avro.util.Utf8 old) longvoidvoidskipFixed(int length) longskipMap()voidMethods inherited from class org.apache.avro.io.Decoder
readFixed
-
Field Details
-
_parser
-
-
Constructor Details
-
DecoderOverAvroParser
-
-
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 tokenIllegalArgumentException- If the next token is not one of theexpectedTokens
-
nextValue
Advance to the next actual value token; This effectively discards the virtual JSON tokens inserted by the parser forSTART_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
Advance to the next token that might contain union branching information; This effectively discards the virtual JSON tokens inserted by the parser forEND_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_OBJECTis 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
- Specified by:
readNullin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readBoolean
- Specified by:
readBooleanin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readInt
- Specified by:
readIntin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readLong
- Specified by:
readLongin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readFloat
- Specified by:
readFloatin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readDouble
- Specified by:
readDoublein classorg.apache.avro.io.Decoder- Throws:
IOException
-
readString
- Specified by:
readStringin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readString
- Specified by:
readStringin classorg.apache.avro.io.Decoder- Throws:
IOException
-
skipString
- Specified by:
skipStringin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readBytes
- Specified by:
readBytesin classorg.apache.avro.io.Decoder- Throws:
IOException
-
skipBytes
- Specified by:
skipBytesin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readFixed
- Specified by:
readFixedin classorg.apache.avro.io.Decoder- Throws:
IOException
-
skipFixed
- Specified by:
skipFixedin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readEnum
- Specified by:
readEnumin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readArrayStart
- Specified by:
readArrayStartin classorg.apache.avro.io.Decoder- Throws:
IOException
-
arrayNext
- Specified by:
arrayNextin classorg.apache.avro.io.Decoder- Throws:
IOException
-
skipArray
- Specified by:
skipArrayin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readMapStart
- Specified by:
readMapStartin classorg.apache.avro.io.Decoder- Throws:
IOException
-
mapNext
- Specified by:
mapNextin classorg.apache.avro.io.Decoder- Throws:
IOException
-
skipMap
- Specified by:
skipMapin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readIndex
- Specified by:
readIndexin classorg.apache.avro.io.Decoder- Throws:
IOException
-