/// <summary> /// This reads a single serialized datum from a file (not an Avro file container /// complete with schema, but the datum only). /// </summary> private static TransferRequest DeserializeSingleDatumFrom(string file) { var result = new TransferRequest(); using (var stream = new FileStream(file, FileMode.Open)) { var decoder = new Avro.IO.BinaryDecoder(stream); var reader = new Avro.Specific.SpecificDefaultReader(result.Schema, result.Schema); reader.Read(result, decoder); } return(result); }
/// <summary> /// Generic read function /// </summary> /// <param name="reuse">object to store data read</param> /// <param name="dec">decorder to use for reading data</param> /// <returns></returns> public T Read(T reuse, Decoder dec) { return(reader.Read(reuse, dec)); }