Avro C#
|
Defines the interface for a class that provides low-level support for serializing Avro values. More...
Public Member Functions | |
void | WriteNull () |
Writes a null value. More... | |
void | WriteBoolean (bool value) |
Writes a boolean value. More... | |
void | WriteInt (int value) |
Writes an int value. More... | |
void | WriteLong (long value) |
Writes a long value. More... | |
void | WriteFloat (float value) |
Writes a float value. More... | |
void | WriteDouble (double value) |
Writes a double value. More... | |
void | WriteBytes (byte[] value) |
Writes a byte string. More... | |
void | WriteBytes (byte[] value, int offset, int length) |
Writes a byte string. More... | |
void | WriteString (string value) |
Writes an Unicode string. More... | |
void | WriteEnum (int value) |
Writes an enumeration. More... | |
void | SetItemCount (long value) |
Call this method before writing a batch of items in an array or a map. More... | |
void | StartItem () |
Start a new item of an array or map. See WriteArrayStart for usage information. More... | |
void | WriteArrayStart () |
Call this method to start writing an array. When starting to serialize an array, call WriteArrayStart. Then, before writing any data for any item call SetItemCount(long) followed by a sequence of StartItem and the item itself. The number of StartItem should match the number specified in SetItemCount(long). When actually writing the data of the item, you can call any Encoder method (e.g., WriteLong(long)). When all items of the array have been written, call WriteArrayEnd. As an example, let's say you want to write an array of records, the record consisting of an Long field and a Boolean field. Your code would look something like this: More... | |
void | WriteArrayEnd () |
Call this method to finish writing an array. See WriteArrayStart for usage information. More... | |
void | WriteMapStart () |
Call this to start a new map. See WriteArrayStart for details on usage. As an example of usage, let's say you want to write a map of records, the record consisting of an Long field and a Boolean field. Your code would look something like this: More... | |
void | WriteMapEnd () |
Call this method to terminate the inner-most, currently-opened map. See WriteArrayStart for more details. More... | |
void | WriteUnionIndex (int value) |
Call this method to write the tag of a union. As an example of usage, let's say you want to write a union, whose second branch is a record consisting of an Long field and a Boolean field. Your code would look something like this: More... | |
void | WriteFixed (byte[] data) |
Writes a fixed value. More... | |
void | WriteFixed (byte[] data, int start, int len) |
Writes a fixed value. More... | |
void | Flush () |
Flushes the encoder. More... | |
Defines the interface for a class that provides low-level support for serializing Avro values.
void Avro.IO.Encoder.Flush | ( | ) |
Flushes the encoder.
Implemented in Avro.IO.BinaryEncoder, Avro.IO.ParsingEncoder, and Avro.IO.JsonEncoder.
void Avro.IO.Encoder.SetItemCount | ( | long | value | ) |
Call this method before writing a batch of items in an array or a map.
value | Number of StartItem calls to follow. |
Implemented in Avro.IO.BinaryEncoder, and Avro.IO.ParsingEncoder.
void Avro.IO.Encoder.StartItem | ( | ) |
Start a new item of an array or map. See WriteArrayStart for usage information.
Implemented in Avro.IO.JsonEncoder, Avro.IO.BinaryEncoder, and Avro.IO.ParsingEncoder.
void Avro.IO.Encoder.WriteArrayEnd | ( | ) |
Call this method to finish writing an array. See WriteArrayStart for usage information.
Implemented in Avro.IO.JsonEncoder, Avro.IO.BinaryEncoder, and Avro.IO.ParsingEncoder.
void Avro.IO.Encoder.WriteArrayStart | ( | ) |
Call this method to start writing an array. When starting to serialize an array, call WriteArrayStart. Then, before writing any data for any item call SetItemCount(long) followed by a sequence of StartItem and the item itself. The number of StartItem should match the number specified in SetItemCount(long). When actually writing the data of the item, you can call any Encoder method (e.g., WriteLong(long)). When all items of the array have been written, call WriteArrayEnd. As an example, let's say you want to write an array of records, the record consisting of an Long field and a Boolean field. Your code would look something like this:
out.WriteArrayStart(); out.SetItemCount(list.Count); foreach (var r in list) { out.StartItem(); out.WriteLong(r.LongField); out.WriteBoolean(r.BoolField); } out.WriteArrayEnd();
Implemented in Avro.IO.JsonEncoder, Avro.IO.BinaryEncoder, and Avro.IO.ParsingEncoder.
void Avro.IO.Encoder.WriteBoolean | ( | bool | value | ) |
Writes a boolean value.
value | Value to write. |
Implemented in Avro.IO.ParsingEncoder, Avro.IO.JsonEncoder, and Avro.IO.BinaryEncoder.
void Avro.IO.Encoder.WriteBytes | ( | byte[] | value | ) |
Writes a byte string.
value | Value to write. |
Implemented in Avro.IO.BinaryEncoder, Avro.IO.ParsingEncoder, and Avro.IO.JsonEncoder.
void Avro.IO.Encoder.WriteBytes | ( | byte[] | value, |
int | offset, | ||
int | length | ||
) |
Writes a byte string.
value | The byte[] to be read (fully or partially) |
offset | The offset from the beginning of the byte[] to start writing |
length | The length of the data to be read from the byte[]. |
Implemented in Avro.IO.BinaryEncoder, Avro.IO.ParsingEncoder, and Avro.IO.JsonEncoder.
void Avro.IO.Encoder.WriteDouble | ( | double | value | ) |
Writes a double value.
value | Value to write. |
Implemented in Avro.IO.BinaryEncoder, Avro.IO.ParsingEncoder, and Avro.IO.JsonEncoder.
void Avro.IO.Encoder.WriteEnum | ( | int | value | ) |
Writes an enumeration.
value | Value to write. |
Implemented in Avro.IO.BinaryEncoder, Avro.IO.ParsingEncoder, and Avro.IO.JsonEncoder.
void Avro.IO.Encoder.WriteFixed | ( | byte[] | data | ) |
Writes a fixed value.
data | The contents to write. |
Implemented in Avro.IO.BinaryEncoder, Avro.IO.ParsingEncoder, and Avro.IO.JsonEncoder.
void Avro.IO.Encoder.WriteFixed | ( | byte[] | data, |
int | start, | ||
int | len | ||
) |
Writes a fixed value.
data | Contents to write. |
start | Position within data where the contents start. |
len | Number of bytes to write. |
Implemented in Avro.IO.BinaryEncoder, Avro.IO.ParsingEncoder, and Avro.IO.JsonEncoder.
void Avro.IO.Encoder.WriteFloat | ( | float | value | ) |
Writes a float value.
value | Value to write. |
Implemented in Avro.IO.BinaryEncoder, Avro.IO.ParsingEncoder, and Avro.IO.JsonEncoder.
void Avro.IO.Encoder.WriteInt | ( | int | value | ) |
Writes an int value.
value | Value to write. |
Implemented in Avro.IO.BinaryEncoder, Avro.IO.ParsingEncoder, and Avro.IO.JsonEncoder.
void Avro.IO.Encoder.WriteLong | ( | long | value | ) |
Writes a long value.
value | Value to write. |
Implemented in Avro.IO.BinaryEncoder, Avro.IO.ParsingEncoder, and Avro.IO.JsonEncoder.
void Avro.IO.Encoder.WriteMapEnd | ( | ) |
Call this method to terminate the inner-most, currently-opened map. See WriteArrayStart for more details.
Implemented in Avro.IO.JsonEncoder, Avro.IO.BinaryEncoder, and Avro.IO.ParsingEncoder.
void Avro.IO.Encoder.WriteMapStart | ( | ) |
Call this to start a new map. See WriteArrayStart for details on usage. As an example of usage, let's say you want to write a map of records, the record consisting of an Long field and a Boolean field. Your code would look something like this:
out.WriteMapStart(); out.SetItemCount(dictionary.Count); foreach (var entry in dictionary) { out.StartItem(); out.WriteString(entry.Key); out.writeLong(entry.Value.LongField); out.writeBoolean(entry.Value.BoolField); } out.WriteMapEnd();
Implemented in Avro.IO.JsonEncoder, Avro.IO.BinaryEncoder, and Avro.IO.ParsingEncoder.
void Avro.IO.Encoder.WriteNull | ( | ) |
Writes a null value.
Implemented in Avro.IO.JsonEncoder, Avro.IO.BinaryEncoder, and Avro.IO.ParsingEncoder.
void Avro.IO.Encoder.WriteString | ( | string | value | ) |
Writes an Unicode string.
value | Value to write. |
Implemented in Avro.IO.BinaryEncoder, Avro.IO.ParsingEncoder, and Avro.IO.JsonEncoder.
void Avro.IO.Encoder.WriteUnionIndex | ( | int | value | ) |
Call this method to write the tag of a union. As an example of usage, let's say you want to write a union, whose second branch is a record consisting of an Long field and a Boolean field. Your code would look something like this:
out.WriteIndex(1); out.WriteLong(record.LongField); out.WriteBoolean(record.BoolField);
value |
Implemented in Avro.IO.BinaryEncoder, Avro.IO.ParsingEncoder, and Avro.IO.JsonEncoder.