Avro C#
Classes | Public Member Functions | Protected Member Functions | List of all members
Avro.IO.JsonDecoder Class Reference

A Decoder for Avro's JSON data encoding. More...

Inheritance diagram for Avro.IO.JsonDecoder:
Avro.IO.ParsingDecoder Avro.IO.Decoder Avro.IO.Parsing.Parser.IActionHandler Avro.IO.Parsing.SkipParser.ISkipHandler

Public Member Functions

 JsonDecoder (Schema schema, Stream stream)
 Initializes a new instance of the JsonDecoder class. More...
 
 JsonDecoder (Schema schema, string str)
 Initializes a new instance of the JsonDecoder class. More...
 
void Configure (Stream stream)
 Reconfigures this JsonDecoder to use the InputStream provided. Otherwise, this JsonDecoder will reset its state and then reconfigure its input. More...
 
void Configure (string str)
 Reconfigures this JsonDecoder to use the String provided for input. Otherwise, this JsonDecoder will reset its state and then reconfigure its input. More...
 
override void ReadNull ()
 Reads a null Avro type.
 
override bool ReadBoolean ()
 Read a boolean Avro type
 
override int ReadInt ()
 Reads an int Avro type.
 
override long ReadLong ()
 Reads a long Avro type.
 
override float ReadFloat ()
 Reads a float Avro type
 
override double ReadDouble ()
 Reads a double Avro type
 
override string ReadString ()
 Reads a string Avro type
 
override void SkipString ()
 Skips a string Avro type on the stream.
 
override byte[] ReadBytes ()
 Reads the bytes Avro type
 
override void SkipBytes ()
 Skips a bytes Avro type on the stream.
 
override void ReadFixed (byte[] bytes)
 A convenience method for ReadFixed(buffer, 0, buffer.Length);
 
override void ReadFixed (byte[] bytes, int start, int len)
 Read a Fixed Avro type of length.
 
override void SkipFixed (int length)
 Skips a fixed of a specified length.
 
override int ReadEnum ()
 Reads an enum AvroType
 
override long ReadArrayStart ()
 Starts reading the array Avro type. This, together with ReadArrayNext() is used to read the items from Avro array. This returns the number of entries in the initial chunk. After consuming the chunk, the client should call ReadArrayNext() to get the number of entries in the next chunk. The client should repeat the procedure until there are no more entries in the array.for (int n = decoder.ReadArrayStart(); n > 0; n = decoder.ReadArrayNext()) { // Read one array entry. }
 
override long ReadArrayNext ()
 See ReadArrayStart().
 
override void SkipArray ()
 Skips an array on the stream.
 
override long ReadMapStart ()
 Starts reading the map Avro type. This, together with ReadMapNext() is used to read the entries from Avro map. This returns the number of entries in the initial chunk. After consuming the chunk, the client should call ReadMapNext() to get the number of entries in the next chunk. The client should repeat the procedure until there are no more entries in the array. for (int n = decoder.ReadMapStart(); n > 0; n = decoder.ReadMapNext()) { // Read one map entry. }
 
override long ReadMapNext ()
 See ReadMapStart().
 
override void SkipMap ()
 Skips a map on the stream.
 
override int ReadUnionIndex ()
 Reads the index, which determines the type in an union Avro type.
 
override void SkipNull ()
 Skips a null Avro type on the stream.
 
override void SkipBoolean ()
 Skips a boolean Avro type on the stream.
 
override void SkipInt ()
 Skips a int Avro type on the stream.
 
override void SkipLong ()
 Skips a long Avro type on the stream.
 
override void SkipFloat ()
 Skips a float Avro type on the stream.
 
override void SkipDouble ()
 Skips a double Avro type on the stream.
 
override void SkipEnum ()
 Skips an enumeration.
 
override void SkipUnionIndex ()
 Skips a union tag index.
 
override Symbol DoAction (Symbol input, Symbol top)
 Handle the action symbol top when the input is sought to be taken off the stack.
 
- Public Member Functions inherited from Avro.IO.ParsingDecoder
virtual void SkipAction ()
 Skips the action at the top of the stack.
 
virtual void SkipTopSymbol ()
 Skips the symbol at the top of the stack.
 

Protected Member Functions

override void SkipFixed ()
 Skips a fixed type on the stream.
 
- Protected Member Functions inherited from Avro.IO.ParsingDecoder
 ParsingDecoder (Symbol root)
 Initializes a new instance of the ParsingDecoder class. More...
 

Additional Inherited Members

- Protected Attributes inherited from Avro.IO.ParsingDecoder
readonly SkipParser Parser
 The parser. More...
 

Detailed Description

A Decoder for Avro's JSON data encoding.

JsonDecoder is not thread-safe.

Constructor & Destructor Documentation

◆ JsonDecoder() [1/2]

Avro.IO.JsonDecoder.JsonDecoder ( Schema  schema,
Stream  stream 
)
inline

Initializes a new instance of the JsonDecoder class.

◆ JsonDecoder() [2/2]

Avro.IO.JsonDecoder.JsonDecoder ( Schema  schema,
string  str 
)
inline

Initializes a new instance of the JsonDecoder class.

Member Function Documentation

◆ Configure() [1/2]

void Avro.IO.JsonDecoder.Configure ( Stream  stream)
inline

Reconfigures this JsonDecoder to use the InputStream provided. Otherwise, this JsonDecoder will reset its state and then reconfigure its input.

Parameters
streamThe InputStream to read from. Cannot be null.

◆ Configure() [2/2]

void Avro.IO.JsonDecoder.Configure ( string  str)
inline

Reconfigures this JsonDecoder to use the String provided for input. Otherwise, this JsonDecoder will reset its state and then reconfigure its input.

Parameters
strThe String to read from. Cannot be null.

The documentation for this class was generated from the following file: