Avro C#

Public Member Functions | List of all members
Avro.IO.BinaryDecoder Class Reference

Decoder for Avro binary format More...

Inheritance diagram for Avro.IO.BinaryDecoder:

## Public Member Functions
| BinaryDecoder (Stream stream)
| Initializes a new instance of the BinaryDecoder class. More...
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...
byte[] | ReadBytes ()
| Bytes are encoded as a long followed by that many bytes of data. More...
int | ReadEnum ()
| Reads an enumeration. More...
long | ReadArrayStart ()
| Reads the size of the first block of an array. More...
long | ReadArrayNext ()
| Processes the next block of an array and returns the number of items in the block and let's the caller read those items. More...
long | ReadMapStart ()
| Reads the size of the next block of map-entries. More...
long | ReadMapNext ()
| Processes the next block of map entries and returns the count of them. More...
int | ReadUnionIndex ()
| Reads the tag index of a union written by BinaryEncoder.WriteUnionIndex(int). More...
void | ReadFixed (byte[] buffer)
| Reads fixed sized binary object. More...
void | ReadFixed (byte[] buffer, int start, int length)
| Reads fixed sized binary object. More...
void | SkipNull ()
| Skips over a null value. More...
void | SkipBoolean ()
| Skips over a boolean value. More...
void | SkipInt ()
| Skips over an int value. More...
void | SkipLong ()
| Skips over a long value. More...
void | SkipFloat ()
| Skips over a float value. More...
void | SkipDouble ()
| Skips over a double value. More...
void | SkipBytes ()
| Skips a byte-string written by BinaryEncoder.WriteBytes(byte[]). More...
void | SkipString ()
| Skips a string written by BinaryEncoder.WriteString(string). More...
void | SkipEnum ()
| Skips an enum value. More...
void | SkipUnionIndex ()
| Skips a union tag index. More...
void | SkipFixed (int len)
| Skips a fixed value of a specified length. 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...
string | ReadString ()
| Reads a string written by BinaryEncoder.WriteString(string). 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...
string | ReadString ()
| Reads a string written by BinaryEncoder.WriteString(string). More...

## Detailed Description

Decoder for Avro binary format

<content> Contains the netstandard2.0 specific functionality for BinaryDecoder. </content>

<content> Contains the netstandard2.1 and netcoreapp2.1 specific functionality for BinaryDecoder. </content>

## Constructor & Destructor Documentation

## ◆ BinaryDecoder()

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

Initializes a new instance of the BinaryDecoder class.

Parameters

  stream | Stream to decode.

## Member Function Documentation

## ◆ ReadArrayNext()

long Avro.IO.BinaryDecoder.ReadArrayNext | ( |  | ) |
| inline

Processes the next block of an array and returns the number of items in the block and let's the caller read those items.

Returns
  Number of items in the next block of an array.

Implements Avro.IO.Decoder.

## ◆ ReadArrayStart()

long Avro.IO.BinaryDecoder.ReadArrayStart | ( |  | ) |
| inline

Reads the size of the first block of an array.

Returns
  Size of the first block of an array.

Implements Avro.IO.Decoder.

## ◆ 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.

## ◆ 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.

## ◆ ReadDouble() [1/2]

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.

Returns
  A double value.

Implements Avro.IO.Decoder.

## ◆ ReadDouble() [2/2]

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.

Returns
  A double value.

Implements Avro.IO.Decoder.

## ◆ ReadEnum()

int Avro.IO.BinaryDecoder.ReadEnum | ( |  | ) |
| inline

Reads an enumeration.

Returns
  Ordinal value of the enum.

Implements Avro.IO.Decoder.

## ◆ ReadFixed() [1/2]

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

Reads fixed sized binary object.

Parameters

  buffer | Buffer to read the fixed value into.

Implements Avro.IO.Decoder.

## ◆ ReadFixed() [2/2]

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

Reads fixed sized binary object.

Parameters

  buffer | Buffer to read the fixed value into.
  start | Position to start writing the fixed value to in the buffer .
  length | Number of bytes of the fixed to read.

Implements Avro.IO.Decoder.

## ◆ ReadFloat() [1/2]

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.

## ◆ ReadFloat() [2/2]

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.

## ◆ ReadInt()

int Avro.IO.BinaryDecoder.ReadInt | ( |  | ) |
| inline

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

Returns
  An integer value.

Implements Avro.IO.Decoder.

## ◆ ReadLong()

long Avro.IO.BinaryDecoder.ReadLong | ( |  | ) |
| inline

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

Returns
  A long value.

Implements Avro.IO.Decoder.

## ◆ ReadMapNext()

long Avro.IO.BinaryDecoder.ReadMapNext | ( |  | ) |
| inline

Processes the next block of map entries and returns the count of them.

Returns
  Number of entires in the next block of a map.

Implements Avro.IO.Decoder.

## ◆ ReadMapStart()

long Avro.IO.BinaryDecoder.ReadMapStart | ( |  | ) |
| inline

Reads the size of the next block of map-entries.

Returns
  Size of the next block of map-entries.

Implements Avro.IO.Decoder.

## ◆ ReadNull()

void Avro.IO.BinaryDecoder.ReadNull | ( |  | ) |
| inline

null is written as zero bytes

Implements Avro.IO.Decoder.

## ◆ ReadString() [1/2]

string Avro.IO.BinaryDecoder.ReadString | ( |  | ) |
| inline

Reads a string written by BinaryEncoder.WriteString(string).

Returns
  String read from the stream.

Implements Avro.IO.Decoder.

## ◆ ReadString() [2/2]

string Avro.IO.BinaryDecoder.ReadString | ( |  | ) |
| inline

Reads a string written by BinaryEncoder.WriteString(string).

Returns
  String read from the stream.

Implements Avro.IO.Decoder.

## ◆ ReadUnionIndex()

int Avro.IO.BinaryDecoder.ReadUnionIndex | ( |  | ) |
| inline

Reads the tag index of a union written by BinaryEncoder.WriteUnionIndex(int).

Returns
  Tag index of a union.

Implements Avro.IO.Decoder.

## ◆ SkipBoolean()

void Avro.IO.BinaryDecoder.SkipBoolean | ( |  | ) |
| inline

Skips over a boolean value.

Implements Avro.IO.Decoder.

## ◆ SkipBytes()

void Avro.IO.BinaryDecoder.SkipBytes | ( |  | ) |
| inline

Skips a byte-string written by BinaryEncoder.WriteBytes(byte[]).

Implements Avro.IO.Decoder.

## ◆ SkipDouble()

void Avro.IO.BinaryDecoder.SkipDouble | ( |  | ) |
| inline

Skips over a double value.

Implements Avro.IO.Decoder.

## ◆ SkipEnum()

void Avro.IO.BinaryDecoder.SkipEnum | ( |  | ) |
| inline

Skips an enum value.

Implements Avro.IO.Decoder.

## ◆ SkipFixed()

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

Skips a fixed value of a specified length.

Parameters

  len | Length of the fixed to skip.

Implements Avro.IO.Decoder.

## ◆ SkipFloat()

void Avro.IO.BinaryDecoder.SkipFloat | ( |  | ) |
| inline

Skips over a float value.

Implements Avro.IO.Decoder.

## ◆ SkipInt()

void Avro.IO.BinaryDecoder.SkipInt | ( |  | ) |
| inline

Skips over an int value.

Implements Avro.IO.Decoder.

## ◆ SkipLong()

void Avro.IO.BinaryDecoder.SkipLong | ( |  | ) |
| inline

Skips over a long value.

Implements Avro.IO.Decoder.

## ◆ SkipNull()

void Avro.IO.BinaryDecoder.SkipNull | ( |  | ) |
| inline

Skips over a null value.

Implements Avro.IO.Decoder.

## ◆ SkipString()

void Avro.IO.BinaryDecoder.SkipString | ( |  | ) |
| inline

Skips a string written by BinaryEncoder.WriteString(string).

Implements Avro.IO.Decoder.

## ◆ SkipUnionIndex()

void Avro.IO.BinaryDecoder.SkipUnionIndex | ( |  | ) |
| inline

Skips a union tag index.

Implements Avro.IO.Decoder.

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

- src/apache/main/IO/BinaryDecoder.cs
- src/apache/main/IO/BinaryDecoder.netstandard2.0.cs
- src/apache/main/IO/BinaryDecoder.notnetstandard2.0.cs