Avro C#
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Avro.IO.ParsingDecoder Class Referenceabstract

Base class for a Parsing.Parser-based Decoders. More...

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

Public Member Functions

void ReadNull ()
 Reads a null Avro type.
 
bool ReadBoolean ()
 Read a boolean Avro type.
Returns
The boolean just read

 
int ReadInt ()
 Reads an int Avro type.
Returns
The int just read

 
long ReadLong ()
 Reads a long Avro type.
Returns
The long just read

 
float ReadFloat ()
 Reads a float Avro type.
Returns
The float just read

 
double ReadDouble ()
 Reads a double Avro type.
Returns
The double just read

 
byte[] ReadBytes ()
 Reads the bytes Avro type.
Returns
The bytes just read

 
string ReadString ()
 Reads a string Avro type.
Returns
The string just read

 
int ReadEnum ()
 Reads an enum AvroType.
Returns
The enum just read

 
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. }
Returns
The number of entries in the initial chunk, 0 if the array is empty.

 
long ReadArrayNext ()
 See ReadArrayStart().
Returns
The number of array entries in the next chunk, 0 if there are no more entries.

 
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. }.
Returns
The number of entries in the initial chunk, 0 if the map is empty.

 
long ReadMapNext ()
 See ReadMapStart().
Returns
The number of map entries in the next chunk, 0 if there are no more entries.

 
int ReadUnionIndex ()
 Reads the index, which determines the type in an union Avro type.
Returns
The index of the type within the union.

 
void ReadFixed (byte[] buffer)
 A convenience method for ReadFixed(buffer, 0, buffer.Length);.
Parameters
bufferThe buffer to read into.

 
void ReadFixed (byte[] buffer, int start, int length)
 Read a Fixed Avro type of length.
Parameters
bufferBuffer to read into
startStarting position of buffer to read into
lengthNumber of bytes to read

 
void SkipNull ()
 Skips a null Avro type on the stream.
 
void SkipBoolean ()
 Skips a boolean Avro type on the stream.
 
void SkipInt ()
 Skips a int Avro type on the stream.
 
void SkipLong ()
 Skips a long Avro type on the stream.
 
void SkipFloat ()
 Skips a float Avro type on the stream.
 
void SkipDouble ()
 Skips a double Avro type on the stream.
 
void SkipBytes ()
 Skips a bytes Avro type on the stream.
 
void SkipString ()
 Skips a string Avro type on the stream.
 
void SkipEnum ()
 Skips an enumeration.
 
void SkipUnionIndex ()
 Skips a union tag index.
 
void SkipFixed (int len)
 Skips a fixed of a specified length.
Parameters
lenLength of the fixed.

 
void SkipArray ()
 Skips an array on the stream.
 
void SkipMap ()
 Skips a map on the stream.
 
Symbol DoAction (Symbol input, Symbol top)
 Handle the action symbol top when the input is sought to be taken off the stack.
Parameters
inputThe input symbol from the caller of Advance
topThe symbol at the top the stack.
Returns
null if Advance() is to continue processing the stack. If not null the return value will be returned by Advance().

 
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

 ParsingDecoder (Symbol root)
 Initializes a new instance of the ParsingDecoder class.
 
void SkipFixed ()
 Skips a fixed type on the stream.
 

Protected Attributes

readonly SkipParser Parser
 The parser.
 

Detailed Description

Base class for a Parsing.Parser-based Decoders.

Member Function Documentation

◆ DoAction()

Symbol Avro.IO.ParsingDecoder.DoAction ( Symbol  input,
Symbol  top 
)
abstract

Handle the action symbol top when the input is sought to be taken off the stack.

Parameters
inputThe input symbol from the caller of Advance
topThe symbol at the top the stack.
Returns
null if Advance() is to continue processing the stack. If not null the return value will be returned by Advance().

Implements Avro.IO.Parsing.Parser.IActionHandler.

◆ ReadArrayNext()

long Avro.IO.ParsingDecoder.ReadArrayNext ( )
abstract

See ReadArrayStart().

Returns
The number of array entries in the next chunk, 0 if there are no more entries.

Implements Avro.IO.Decoder.

◆ ReadArrayStart()

long Avro.IO.ParsingDecoder.ReadArrayStart ( )
abstract

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. }

Returns
The number of entries in the initial chunk, 0 if the array is empty.

Implements Avro.IO.Decoder.

◆ ReadBoolean()

bool Avro.IO.ParsingDecoder.ReadBoolean ( )
abstract

Read a boolean Avro type.

Returns
The boolean just read

Implements Avro.IO.Decoder.

◆ ReadBytes()

byte[] Avro.IO.ParsingDecoder.ReadBytes ( )
abstract

Reads the bytes Avro type.

Returns
The bytes just read

Implements Avro.IO.Decoder.

◆ ReadDouble()

double Avro.IO.ParsingDecoder.ReadDouble ( )
abstract

Reads a double Avro type.

Returns
The double just read

Implements Avro.IO.Decoder.

◆ ReadEnum()

int Avro.IO.ParsingDecoder.ReadEnum ( )
abstract

Reads an enum AvroType.

Returns
The enum just read

Implements Avro.IO.Decoder.

◆ ReadFixed() [1/2]

void Avro.IO.ParsingDecoder.ReadFixed ( byte[]  buffer)
abstract

A convenience method for ReadFixed(buffer, 0, buffer.Length);.

Parameters
bufferThe buffer to read into.

Implements Avro.IO.Decoder.

◆ ReadFixed() [2/2]

void Avro.IO.ParsingDecoder.ReadFixed ( byte[]  buffer,
int  start,
int  length 
)
abstract

Read a Fixed Avro type of length.

Parameters
bufferBuffer to read into
startStarting position of buffer to read into
lengthNumber of bytes to read

Implements Avro.IO.Decoder.

◆ ReadFloat()

float Avro.IO.ParsingDecoder.ReadFloat ( )
abstract

Reads a float Avro type.

Returns
The float just read

Implements Avro.IO.Decoder.

◆ ReadInt()

int Avro.IO.ParsingDecoder.ReadInt ( )
abstract

Reads an int Avro type.

Returns
The int just read

Implements Avro.IO.Decoder.

◆ ReadLong()

long Avro.IO.ParsingDecoder.ReadLong ( )
abstract

Reads a long Avro type.

Returns
The long just read

Implements Avro.IO.Decoder.

◆ ReadMapNext()

long Avro.IO.ParsingDecoder.ReadMapNext ( )
abstract

See ReadMapStart().

Returns
The number of map entries in the next chunk, 0 if there are no more entries.

Implements Avro.IO.Decoder.

◆ ReadMapStart()

long Avro.IO.ParsingDecoder.ReadMapStart ( )
abstract

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. }.

Returns
The number of entries in the initial chunk, 0 if the map is empty.

Implements Avro.IO.Decoder.

◆ ReadNull()

void Avro.IO.ParsingDecoder.ReadNull ( )
abstract

Reads a null Avro type.

Implements Avro.IO.Decoder.

◆ ReadString()

string Avro.IO.ParsingDecoder.ReadString ( )
abstract

Reads a string Avro type.

Returns
The string just read

Implements Avro.IO.Decoder.

◆ ReadUnionIndex()

int Avro.IO.ParsingDecoder.ReadUnionIndex ( )
abstract

Reads the index, which determines the type in an union Avro type.

Returns
The index of the type within the union.

Implements Avro.IO.Decoder.

◆ SkipAction()

virtual void Avro.IO.ParsingDecoder.SkipAction ( )
inlinevirtual

Skips the action at the top of the stack.

Implements Avro.IO.Parsing.SkipParser.ISkipHandler.

◆ SkipBoolean()

void Avro.IO.ParsingDecoder.SkipBoolean ( )
abstract

Skips a boolean Avro type on the stream.

Implements Avro.IO.Decoder.

◆ SkipBytes()

void Avro.IO.ParsingDecoder.SkipBytes ( )
abstract

Skips a bytes Avro type on the stream.

Implements Avro.IO.Decoder.

◆ SkipDouble()

void Avro.IO.ParsingDecoder.SkipDouble ( )
abstract

Skips a double Avro type on the stream.

Implements Avro.IO.Decoder.

◆ SkipEnum()

void Avro.IO.ParsingDecoder.SkipEnum ( )
abstract

Skips an enumeration.

Implements Avro.IO.Decoder.

◆ SkipFixed()

void Avro.IO.ParsingDecoder.SkipFixed ( int  len)
abstract

Skips a fixed of a specified length.

Parameters
lenLength of the fixed.

Implements Avro.IO.Decoder.

◆ SkipFloat()

void Avro.IO.ParsingDecoder.SkipFloat ( )
abstract

Skips a float Avro type on the stream.

Implements Avro.IO.Decoder.

◆ SkipInt()

void Avro.IO.ParsingDecoder.SkipInt ( )
abstract

Skips a int Avro type on the stream.

Implements Avro.IO.Decoder.

◆ SkipLong()

void Avro.IO.ParsingDecoder.SkipLong ( )
abstract

Skips a long Avro type on the stream.

Implements Avro.IO.Decoder.

◆ SkipNull()

void Avro.IO.ParsingDecoder.SkipNull ( )
abstract

Skips a null Avro type on the stream.

Implements Avro.IO.Decoder.

◆ SkipString()

void Avro.IO.ParsingDecoder.SkipString ( )
abstract

Skips a string Avro type on the stream.

Implements Avro.IO.Decoder.

◆ SkipTopSymbol()

virtual void Avro.IO.ParsingDecoder.SkipTopSymbol ( )
inlinevirtual

Skips the symbol at the top of the stack.

Implements Avro.IO.Parsing.SkipParser.ISkipHandler.

◆ SkipUnionIndex()

void Avro.IO.ParsingDecoder.SkipUnionIndex ( )
abstract

Skips a union tag index.

Implements Avro.IO.Decoder.


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