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
streamStreamThe destination.
schemaAvroSchemaThe schema of every object in the file.
writeAvroWriteAction<T>Writes one object in
schema's encoding; for a generated type, its staticWritemethod.optionsAvroFileWriterOptionsThe file options, or null for the defaults.
Returns
Type Parameters
TThe 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
streamStreamThe destination.
optionsAvroFileWriterOptionsThe file options, or null for the defaults.
Returns
Type Parameters
TA generated type.
Exceptions
- ArgumentException
The metadata uses a reserved key.