Public Member Functions

Avro::IO::BinaryDecoder Class Reference

Decoder for Avro binary format. More...

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

List of all members.

Public Member Functions

 BinaryDecoder (Stream stream)
void ReadNull ()
 null is written as zero bytes
bool ReadBoolean ()
 a boolean is written as a single byte whose value is either 0 (false) or 1 (true).
int ReadInt ()
 int and long values are written using variable-length, zig-zag coding.
long ReadLong ()
 int and long values are written using variable-length, zig-zag coding.
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.
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.
byte[] ReadBytes ()
 Bytes are encoded as a long followed by that many bytes of data.
string ReadString ()
 Reads a string Avro type.
int ReadEnum ()
 Reads an enum AvroType.
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.
long ReadArrayNext ()
 See ReadArrayStart().
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. }.
long ReadMapNext ()
 See ReadMapStart().
int ReadUnionIndex ()
 Reads the index, which determines the type in an union Avro type.
void ReadFixed (byte[] buffer)
 A convenience method for ReadFixed(buffer, 0, buffer.Length);.
void ReadFixed (byte[] buffer, int start, int length)
 Read a Fixed Avro type of length.
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 ()
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,
int  start,
int  length 
) [inline]

Read a Fixed Avro type of length.

Parameters:
buffer Buffer to read into
start Starting position of buffer to read into
length Number of bytes to read

Implements Avro::IO::Decoder.

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

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

Parameters:
buffer The buffer to read into.

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:
 All Classes Namespaces Functions Variables Enumerations Properties