avro in-memory serialization and deserialization