Kinetica   C#   API  Version 7.2.3.0
Avro.IO.BinaryDecoder Class Reference

Decoder for Avro binary format More...

+ Inheritance diagram for Avro.IO.BinaryDecoder:
+ Collaboration diagram for Avro.IO.BinaryDecoder:

Public Member Functions

 BinaryDecoder (Stream stream)
 
void ReadNull ()
 null is written as zero bytes More...
 
bool ReadBoolean ()
 a boolean is written as a single byte whose value is either 0 (false) or 1 (true). More...
 
int ReadInt ()
 int and long values are written using variable-length, zig-zag coding. More...
 
long ReadLong ()
 int and long values are written using variable-length, zig-zag coding. More...
 
float ReadFloat ()
 A float is written as 4 bytes. More...
 
double ReadDouble ()
 A double is written as 8 bytes. More...
 
byte [] ReadBytes ()
 Bytes are encoded as a long followed by that many bytes of data. More...
 
string ReadString ()
 Reads a string Avro type More...
 
int ReadEnum ()
 Reads an enum AvroType More...
 
long ReadArrayStart ()
 Starts reading the array Avro type. More...
 
long ReadArrayNext ()
 See ReadArrayStart(). More...
 
long ReadMapStart ()
 Starts reading the map Avro type. More...
 
long ReadMapNext ()
 See ReadMapStart(). More...
 
int ReadUnionIndex ()
 Reads the index, which determines the type in an union Avro type. More...
 
void ReadFixed (byte[] buffer)
 A convenience method for ReadFixed(buffer, 0, buffer.Length); More...
 
void ReadFixed (byte[] buffer, int start, int length)
 Read a Fixed Avro type of length. More...
 
void SkipNull ()
 Skips a null Avro type on the stream. More...
 
void SkipBoolean ()
 Skips a boolean Avro type on the stream. More...
 
void SkipInt ()
 Skips a int Avro type on the stream. More...
 
void SkipLong ()
 Skips a long Avro type on the stream. More...
 
void SkipFloat ()
 Skips a float Avro type on the stream. More...
 
void SkipDouble ()
 Skips a double Avro type on the stream. More...
 
void SkipBytes ()
 Skips a bytes Avro type on the stream. More...
 
void SkipString ()
 Skips a string Avro type on the stream. More...
 
void SkipEnum ()
 
void SkipUnionIndex ()
 
void SkipFixed (int len)
 

Detailed Description

Decoder for Avro binary format

Definition at line 27 of file BinaryDecoder.cs.

Constructor & Destructor Documentation

◆ BinaryDecoder()

Avro.IO.BinaryDecoder.BinaryDecoder ( Stream  stream)
inline

Definition at line 31 of file BinaryDecoder.cs.

Member Function Documentation

◆ ReadArrayNext()

long Avro.IO.BinaryDecoder.ReadArrayNext ( )
inline

See ReadArrayStart().

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

Implements Avro.IO.Decoder.

Definition at line 155 of file BinaryDecoder.cs.

◆ ReadArrayStart()

long Avro.IO.BinaryDecoder.ReadArrayStart ( )
inline

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.

Definition at line 150 of file BinaryDecoder.cs.

◆ ReadBoolean()

bool Avro.IO.BinaryDecoder.ReadBoolean ( )
inline

a boolean is written as a single byte whose value is either 0 (false) or 1 (true).

Returns

Implements Avro.IO.Decoder.

Definition at line 48 of file BinaryDecoder.cs.

◆ ReadBytes()

byte [] Avro.IO.BinaryDecoder.ReadBytes ( )
inline

Bytes are encoded as a long followed by that many bytes of data.

Returns

Implements Avro.IO.Decoder.

Definition at line 131 of file BinaryDecoder.cs.

◆ ReadDouble()

double Avro.IO.BinaryDecoder.ReadDouble ( )
inline

A double is written as 8 bytes.

The double is converted into a 64-bit integer using a method equivalent to Java's doubleToLongBits and then encoded in little-endian format.

Parameters
?
Returns

Implements Avro.IO.Decoder.

Definition at line 114 of file BinaryDecoder.cs.

◆ ReadEnum()

int Avro.IO.BinaryDecoder.ReadEnum ( )
inline

Reads an enum AvroType

Returns
The enum just read

Implements Avro.IO.Decoder.

Definition at line 145 of file BinaryDecoder.cs.

◆ ReadFixed() [1/2]

void Avro.IO.BinaryDecoder.ReadFixed ( byte []  buffer)
inline

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

Parameters
bufferThe buffer to read into.

Implements Avro.IO.Decoder.

Definition at line 175 of file BinaryDecoder.cs.

◆ ReadFixed() [2/2]

void Avro.IO.BinaryDecoder.ReadFixed ( byte []  buffer,
int  start,
int  length 
)
inline

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.

Definition at line 180 of file BinaryDecoder.cs.

◆ ReadFloat()

float Avro.IO.BinaryDecoder.ReadFloat ( )
inline

A float is written as 4 bytes.

The float is converted into a 32-bit integer using a method equivalent to Java's floatToIntBits and then encoded in little-endian format.

Returns

Implements Avro.IO.Decoder.

Definition at line 91 of file BinaryDecoder.cs.

◆ ReadInt()

int Avro.IO.BinaryDecoder.ReadInt ( )
inline

int and long values are written using variable-length, zig-zag coding.

Parameters
?
Returns

Implements Avro.IO.Decoder.

Definition at line 61 of file BinaryDecoder.cs.

◆ ReadLong()

long Avro.IO.BinaryDecoder.ReadLong ( )
inline

int and long values are written using variable-length, zig-zag coding.

Parameters
?
Returns

Implements Avro.IO.Decoder.

Definition at line 70 of file BinaryDecoder.cs.

◆ ReadMapNext()

long Avro.IO.BinaryDecoder.ReadMapNext ( )
inline

See ReadMapStart().

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

Implements Avro.IO.Decoder.

Definition at line 165 of file BinaryDecoder.cs.

◆ ReadMapStart()

long Avro.IO.BinaryDecoder.ReadMapStart ( )
inline

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

Definition at line 160 of file BinaryDecoder.cs.

◆ ReadNull()

void Avro.IO.BinaryDecoder.ReadNull ( )
inline

null is written as zero bytes

Implements Avro.IO.Decoder.

Definition at line 39 of file BinaryDecoder.cs.

◆ ReadString()

string Avro.IO.BinaryDecoder.ReadString ( )
inline

Reads a string Avro type

Returns
The string just read

Implements Avro.IO.Decoder.

Definition at line 136 of file BinaryDecoder.cs.

◆ ReadUnionIndex()

int Avro.IO.BinaryDecoder.ReadUnionIndex ( )
inline

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.

Definition at line 170 of file BinaryDecoder.cs.

◆ SkipBoolean()

void Avro.IO.BinaryDecoder.SkipBoolean ( )
inline

Skips a boolean Avro type on the stream.

Implements Avro.IO.Decoder.

Definition at line 190 of file BinaryDecoder.cs.

◆ SkipBytes()

void Avro.IO.BinaryDecoder.SkipBytes ( )
inline

Skips a bytes Avro type on the stream.

Implements Avro.IO.Decoder.

Definition at line 216 of file BinaryDecoder.cs.

◆ SkipDouble()

void Avro.IO.BinaryDecoder.SkipDouble ( )
inline

Skips a double Avro type on the stream.

Implements Avro.IO.Decoder.

Definition at line 211 of file BinaryDecoder.cs.

◆ SkipEnum()

void Avro.IO.BinaryDecoder.SkipEnum ( )
inline

Implements Avro.IO.Decoder.

Definition at line 226 of file BinaryDecoder.cs.

◆ SkipFixed()

void Avro.IO.BinaryDecoder.SkipFixed ( int  len)
inline

Implements Avro.IO.Decoder.

Definition at line 236 of file BinaryDecoder.cs.

◆ SkipFloat()

void Avro.IO.BinaryDecoder.SkipFloat ( )
inline

Skips a float Avro type on the stream.

Implements Avro.IO.Decoder.

Definition at line 206 of file BinaryDecoder.cs.

◆ SkipInt()

void Avro.IO.BinaryDecoder.SkipInt ( )
inline

Skips a int Avro type on the stream.

Implements Avro.IO.Decoder.

Definition at line 196 of file BinaryDecoder.cs.

◆ SkipLong()

void Avro.IO.BinaryDecoder.SkipLong ( )
inline

Skips a long Avro type on the stream.

Implements Avro.IO.Decoder.

Definition at line 201 of file BinaryDecoder.cs.

◆ SkipNull()

void Avro.IO.BinaryDecoder.SkipNull ( )
inline

Skips a null Avro type on the stream.

Implements Avro.IO.Decoder.

Definition at line 185 of file BinaryDecoder.cs.

◆ SkipString()

void Avro.IO.BinaryDecoder.SkipString ( )
inline

Skips a string Avro type on the stream.

Implements Avro.IO.Decoder.

Definition at line 221 of file BinaryDecoder.cs.

◆ SkipUnionIndex()

void Avro.IO.BinaryDecoder.SkipUnionIndex ( )
inline

Implements Avro.IO.Decoder.

Definition at line 231 of file BinaryDecoder.cs.


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