Package org.apache.avro
Class ExtendedJsonDecoder
- java.lang.Object
-
- org.apache.avro.io.Decoder
-
- org.apache.avro.io.ParsingDecoder
-
- org.apache.avro.ExtendedJsonDecoder
-
- All Implemented Interfaces:
org.apache.avro.io.parsing.Parser.ActionHandler,org.apache.avro.io.parsing.SkipParser.SkipHandler
public class ExtendedJsonDecoder extends org.apache.avro.io.ParsingDecoder implements org.apache.avro.io.parsing.Parser.ActionHandlerADecoderfor Avro's JSON data encoding.Construct using
ExtendedJsonDecoder is not thread-safe.DecoderFactory.Based on
JsonDecoderand ExtendedJsonDecoder. Infers default arguments, if they are not present.
-
-
Constructor Summary
Constructors Constructor Description ExtendedJsonDecoder(org.apache.avro.Schema schema, InputStream in)ExtendedJsonDecoder(org.apache.avro.Schema schema, String in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longarrayNext()ExtendedJsonDecoderconfigure(InputStream in)Reconfigures this JsonDecoder to use the InputStream provided.ExtendedJsonDecoderconfigure(String in)Reconfigures this JsonDecoder to use the String provided for input.org.apache.avro.io.parsing.SymboldoAction(org.apache.avro.io.parsing.Symbol input, org.apache.avro.io.parsing.Symbol top)longmapNext()longreadArrayStart()booleanreadBoolean()ByteBufferreadBytes(ByteBuffer old)doublereadDouble()intreadEnum()voidreadFixed(byte[] bytes, int start, int len)floatreadFloat()intreadIndex()intreadInt()longreadLong()longreadMapStart()voidreadNull()StringreadString()org.apache.avro.util.Utf8readString(org.apache.avro.util.Utf8 old)longskipArray()voidskipBytes()protected voidskipFixed()voidskipFixed(int length)longskipMap()voidskipString()
-
-
-
Constructor Detail
-
ExtendedJsonDecoder
public ExtendedJsonDecoder(org.apache.avro.Schema schema, InputStream in) throws IOException- Throws:
IOException
-
ExtendedJsonDecoder
public ExtendedJsonDecoder(org.apache.avro.Schema schema, String in) throws IOException- Throws:
IOException
-
-
Method Detail
-
configure
public ExtendedJsonDecoder configure(InputStream in) throws IOException
Reconfigures this JsonDecoder to use the InputStream provided.
If the InputStream provided is null, a NullPointerException is thrown.
Otherwise, this JsonDecoder will reset its state and then reconfigure its input.- Parameters:
in- The IntputStream to read from. Cannot be null.- Returns:
- this JsonDecoder
- Throws:
IOException
-
configure
public ExtendedJsonDecoder configure(String in) throws IOException
Reconfigures this JsonDecoder to use the String provided for input.
If the String provided is null, a NullPointerException is thrown.
Otherwise, this JsonDecoder will reset its state and then reconfigure its input.- Parameters:
in- The String to read from. Cannot be null.- Returns:
- this JsonDecoder
- Throws:
IOException
-
readNull
public void readNull() throws IOException- Specified by:
readNullin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readBoolean
public boolean readBoolean() throws IOException- Specified by:
readBooleanin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readInt
public int readInt() throws IOException- Specified by:
readIntin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readLong
public long readLong() throws IOException- Specified by:
readLongin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readFloat
public float readFloat() throws IOException- Specified by:
readFloatin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readDouble
public double readDouble() throws IOException- Specified by:
readDoublein classorg.apache.avro.io.Decoder- Throws:
IOException
-
readString
public org.apache.avro.util.Utf8 readString(org.apache.avro.util.Utf8 old) throws IOException- Specified by:
readStringin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readString
public String readString() throws IOException
- Specified by:
readStringin classorg.apache.avro.io.Decoder- Throws:
IOException
-
skipString
public void skipString() throws IOException- Specified by:
skipStringin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readBytes
public ByteBuffer readBytes(ByteBuffer old) throws IOException
- Specified by:
readBytesin classorg.apache.avro.io.Decoder- Throws:
IOException
-
skipBytes
public void skipBytes() throws IOException- Specified by:
skipBytesin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readFixed
public void readFixed(byte[] bytes, int start, int len) throws IOException- Specified by:
readFixedin classorg.apache.avro.io.Decoder- Throws:
IOException
-
skipFixed
public void skipFixed(int length) throws IOException- Specified by:
skipFixedin classorg.apache.avro.io.Decoder- Throws:
IOException
-
skipFixed
protected void skipFixed() throws IOException- Specified by:
skipFixedin classorg.apache.avro.io.ParsingDecoder- Throws:
IOException
-
readEnum
public int readEnum() throws IOException- Specified by:
readEnumin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readArrayStart
public long readArrayStart() throws IOException- Specified by:
readArrayStartin classorg.apache.avro.io.Decoder- Throws:
IOException
-
arrayNext
public long arrayNext() throws IOException- Specified by:
arrayNextin classorg.apache.avro.io.Decoder- Throws:
IOException
-
skipArray
public long skipArray() throws IOException- Specified by:
skipArrayin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readMapStart
public long readMapStart() throws IOException- Specified by:
readMapStartin classorg.apache.avro.io.Decoder- Throws:
IOException
-
mapNext
public long mapNext() throws IOException- Specified by:
mapNextin classorg.apache.avro.io.Decoder- Throws:
IOException
-
skipMap
public long skipMap() throws IOException- Specified by:
skipMapin classorg.apache.avro.io.Decoder- Throws:
IOException
-
readIndex
public int readIndex() throws IOException- Specified by:
readIndexin classorg.apache.avro.io.Decoder- Throws:
IOException
-
doAction
public org.apache.avro.io.parsing.Symbol doAction(org.apache.avro.io.parsing.Symbol input, org.apache.avro.io.parsing.Symbol top) throws IOException- Specified by:
doActionin interfaceorg.apache.avro.io.parsing.Parser.ActionHandler- Throws:
IOException
-
-