Avro C#

Public Member Functions | Properties | List of all members
Avro.Generic.GenericWriter< T > Class Template Reference

A typesafe wrapper around DefaultWriter. While a specific object of DefaultWriter allows the client to serialize a generic type, an object of this class allows only a single type of object to be serialized through it. More...

Inheritance diagram for Avro.Generic.GenericWriter< T >:

## Public Member Functions
| GenericWriter (Schema schema)
| Initializes a new instance of the GenericWriter<T> class. More...
| GenericWriter (DefaultWriter writer)
| Initializes a new instance of the GenericWriter<T> class from a DefaultWriter. More...
void | Write (T value, Encoder encoder)
| Serializes the given object using this writer's schema. More...

## Properties
Schema | Schema`[get]`
Properties inherited from Avro.Generic.DatumWriter< T >
Schema | Schema`[get]`
| Schema used to write the data. More...

## Detailed Description

A typesafe wrapper around DefaultWriter. While a specific object of DefaultWriter allows the client to serialize a generic type, an object of this class allows only a single type of object to be serialized through it.

Template Parameters

  T | The type of object to be serialized.

## Constructor & Destructor Documentation

## ◆ GenericWriter() [1/2]

Avro.Generic.GenericWriter< T >.GenericWriter | ( | Schema | schema | ) |
| inline

Initializes a new instance of the GenericWriter<T> class.

Parameters

  schema | Schema to use when writing.

## ◆ GenericWriter() [2/2]

Avro.Generic.GenericWriter< T >.GenericWriter | ( | DefaultWriter | writer | ) |
| inline

Initializes a new instance of the GenericWriter<T> class from a DefaultWriter.

Parameters

  writer | Write to initialize this new writer from.

## Member Function Documentation

## ◆ Write()

void Avro.Generic.GenericWriter< T >.Write | ( | T | value,
|  | Encoder | encoder
| ) |  |
| inline

Serializes the given object using this writer's schema.

Parameters

  value | The value to be serialized
  encoder | The encoder to use for serializing

Implements Avro.Generic.DatumWriter< T >.

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

- src/apache/main/Generic/GenericWriter.cs