Avro C#

Public Member Functions | List of all members
Avro.IO.Decoder Interface Reference

Decoder is used to decode Avro data on a stream. There are methods to read the Avro types on the stream. There are also methods to skip items, which are usually more efficient than reading, on the stream. More...

Inheritance diagram for Avro.IO.Decoder:

## Public Member Functions
void | ReadNull ()
| Reads a null Avro type. More...
bool | ReadBoolean ()
| Read a boolean Avro type More...
int | ReadInt ()
| Reads an int Avro type. More...
long | ReadLong ()
| Reads a long Avro type. More...
float | ReadFloat ()
| Reads a float Avro type More...
double | ReadDouble ()
| Reads a double Avro type More...
byte[] | ReadBytes ()
| Reads the bytes Avro type 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 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. } 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 ()
| Skips an enumeration. More...
void | SkipUnionIndex ()
| Skips a union tag index. More...
void | SkipFixed (int len)
| Skips a fixed of a specified length. More...

## Detailed Description

Decoder is used to decode Avro data on a stream. There are methods to read the Avro types on the stream. There are also methods to skip items, which are usually more efficient than reading, on the stream.

## Member Function Documentation

## ◆ ReadArrayNext()

long Avro.IO.Decoder.ReadArrayNext | ( |  | ) |

See ReadArrayStart().

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

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ ReadArrayStart()

long Avro.IO.Decoder.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.

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ ReadBoolean()

bool Avro.IO.Decoder.ReadBoolean | ( |  | ) |

Read a boolean Avro type

Returns
  The boolean just read

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ ReadBytes()

byte [] Avro.IO.Decoder.ReadBytes | ( |  | ) |

Reads the bytes Avro type

Returns
  The bytes just read

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ ReadDouble()

double Avro.IO.Decoder.ReadDouble | ( |  | ) |

Reads a double Avro type

Returns
  The double just read

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ ReadEnum()

int Avro.IO.Decoder.ReadEnum | ( |  | ) |

Reads an enum AvroType

Returns
  The enum just read

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ ReadFixed() [1/2]

void Avro.IO.Decoder.ReadFixed | ( | byte[] | buffer | ) |

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

Parameters

  buffer | The buffer to read into.

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ ReadFixed() [2/2]

void Avro.IO.Decoder.ReadFixed | ( | byte[] | buffer,
|  | int | start,
|  | int | length
| ) |  |

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

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ ReadFloat()

float Avro.IO.Decoder.ReadFloat | ( |  | ) |

Reads a float Avro type

Returns
  The float just read

Implemented in Avro.IO.JsonDecoder, Avro.IO.ParsingDecoder, Avro.IO.BinaryDecoder, and Avro.IO.BinaryDecoder.

## ◆ ReadInt()

int Avro.IO.Decoder.ReadInt | ( |  | ) |

Reads an int Avro type.

Returns
  The int just read

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ ReadLong()

long Avro.IO.Decoder.ReadLong | ( |  | ) |

Reads a long Avro type.

Returns
  The long just read

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ ReadMapNext()

long Avro.IO.Decoder.ReadMapNext | ( |  | ) |

See ReadMapStart().

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

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ ReadMapStart()

long Avro.IO.Decoder.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.

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ ReadNull()

void Avro.IO.Decoder.ReadNull | ( |  | ) |

Reads a null Avro type.

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ ReadString()

string Avro.IO.Decoder.ReadString | ( |  | ) |

Reads a string Avro type

Returns
  The string just read

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ ReadUnionIndex()

int Avro.IO.Decoder.ReadUnionIndex | ( |  | ) |

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

Returns
  The index of the type within the union.

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ SkipBoolean()

void Avro.IO.Decoder.SkipBoolean | ( |  | ) |

Skips a boolean Avro type on the stream.

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ SkipBytes()

void Avro.IO.Decoder.SkipBytes | ( |  | ) |

Skips a bytes Avro type on the stream.

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ SkipDouble()

void Avro.IO.Decoder.SkipDouble | ( |  | ) |

Skips a double Avro type on the stream.

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ SkipEnum()

void Avro.IO.Decoder.SkipEnum | ( |  | ) |

Skips an enumeration.

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ SkipFixed()

void Avro.IO.Decoder.SkipFixed | ( | int | len | ) |

Skips a fixed of a specified length.

Parameters

  len | Length of the fixed.

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ SkipFloat()

void Avro.IO.Decoder.SkipFloat | ( |  | ) |

Skips a float Avro type on the stream.

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ SkipInt()

void Avro.IO.Decoder.SkipInt | ( |  | ) |

Skips a int Avro type on the stream.

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ SkipLong()

void Avro.IO.Decoder.SkipLong | ( |  | ) |

Skips a long Avro type on the stream.

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ SkipNull()

void Avro.IO.Decoder.SkipNull | ( |  | ) |

Skips a null Avro type on the stream.

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

## ◆ SkipString()

void Avro.IO.Decoder.SkipString | ( |  | ) |

Skips a string Avro type on the stream.

Implemented in Avro.IO.BinaryDecoder, Avro.IO.JsonDecoder, and Avro.IO.ParsingDecoder.

## ◆ SkipUnionIndex()

void Avro.IO.Decoder.SkipUnionIndex | ( |  | ) |

Skips a union tag index.

Implemented in Avro.IO.JsonDecoder, Avro.IO.BinaryDecoder, and Avro.IO.ParsingDecoder.

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

- src/apache/main/IO/Decoder.cs