Table of Contents

Method Create

Namespace
AvroSharp.Containers
Assembly
AvroSharp.dll

Create<T>(Stream, AvroSchema, AvroWriteAction<T>, AvroFileWriterOptions?)

Creates a writer. The header is written with the first block, or when the writer is flushed or disposed.

public static AvroFileWriter<T> Create<T>(Stream stream, AvroSchema schema, AvroWriteAction<T> write, AvroFileWriterOptions? options = null)

Parameters

stream Stream

The destination.

schema AvroSchema

The schema of every object in the file.

write AvroWriteAction<T>

Writes one object in schema's encoding; for a generated type, its static Write method.

options AvroFileWriterOptions

The file options, or null for the defaults.

Returns

AvroFileWriter<T>

Type Parameters

T

The type of the objects.

Exceptions

ArgumentException

The metadata uses a reserved key.

Create<T>(Stream, AvroFileWriterOptions?)

Creates a container file of a generated type, with its schema.

public static AvroFileWriter<T> Create<T>(Stream stream, AvroFileWriterOptions? options = null) where T : IAvroSerializable<T>

Parameters

stream Stream

The destination.

options AvroFileWriterOptions

The file options, or null for the defaults.

Returns

AvroFileWriter<T>

Type Parameters

T

A generated type.

Exceptions

ArgumentException

The metadata uses a reserved key.