Avro C#
 All Classes Namespaces Functions Variables Enumerations Properties
Public Member Functions | List of all members
Avro.IO.BinaryDecoder Class Reference

Decoder for Avro binary format More...

Inheritance diagram for Avro.IO.BinaryDecoder:
Avro.IO.Decoder

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. The float is converted into a 32-bit integer using a method equivalent to Java's floatToIntBits and then encoded in little-endian format. More...
 
double ReadDouble ()
 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. 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. 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. More...
 
long ReadArrayNext ()
 See ReadArrayStart(). More...
 
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 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. } 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

Member Function Documentation

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.

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.

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.

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

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

Returns

Implements Avro.IO.Decoder.

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.

int Avro.IO.BinaryDecoder.ReadEnum ( )
inline

Reads an enum AvroType

Returns
The enum just read

Implements Avro.IO.Decoder.

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.

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.

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.

int Avro.IO.BinaryDecoder.ReadInt ( )
inline

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

Parameters
?
Returns

Implements Avro.IO.Decoder.

long Avro.IO.BinaryDecoder.ReadLong ( )
inline

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

Parameters
?
Returns

Implements Avro.IO.Decoder.

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.

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.

void Avro.IO.BinaryDecoder.ReadNull ( )
inline

null is written as zero bytes

Implements Avro.IO.Decoder.

string Avro.IO.BinaryDecoder.ReadString ( )
inline

Reads a string Avro type

Returns
The string just read

Implements Avro.IO.Decoder.

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.

void Avro.IO.BinaryDecoder.SkipBoolean ( )
inline

Skips a boolean Avro type on the stream.

Implements Avro.IO.Decoder.

void Avro.IO.BinaryDecoder.SkipBytes ( )
inline

Skips a bytes Avro type on the stream.

Implements Avro.IO.Decoder.

void Avro.IO.BinaryDecoder.SkipDouble ( )
inline

Skips a double Avro type on the stream.

Implements Avro.IO.Decoder.

void Avro.IO.BinaryDecoder.SkipFloat ( )
inline

Skips a float Avro type on the stream.

Implements Avro.IO.Decoder.

void Avro.IO.BinaryDecoder.SkipInt ( )
inline

Skips a int Avro type on the stream.

Implements Avro.IO.Decoder.

void Avro.IO.BinaryDecoder.SkipLong ( )
inline

Skips a long Avro type on the stream.

Implements Avro.IO.Decoder.

void Avro.IO.BinaryDecoder.SkipNull ( )
inline

Skips a null Avro type on the stream.

Implements Avro.IO.Decoder.

void Avro.IO.BinaryDecoder.SkipString ( )
inline

Skips a string Avro type on the stream.

Implements Avro.IO.Decoder.


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