I guess I'll answer my own question.  It doesn't appear that the GenericWriter 
actually writes the schema.  So I suppose my best option is to just write it 
myself before writing the record:
encoder.WriteString(schema.ToString());
and then read it off before reading the record:
var writeSchema = Schema.Parse(decoder.ReadString());

I guess the schema is only normally included with the data for actual Avro data 
files (not yet supported in C#).

- Tim

From: Tim Goodman
Sent: Tuesday, May 28, 2013 10:41 AM
To: '[email protected]'
Subject: Avro serialization in C# - how to include schema

I'm trying to use Avro serialization in C#.  My understanding is that normally 
with Avro the schema is written with the data.

But the constructor for GenericReader<T> requires both a writer schema and a 
reader schema.  Is there a way to extract the writer schema from the data?  (In 
my case I wrote it with GenericWriter<T> and the BinaryEncoder).

- Tim Goodman

Reply via email to