19 using System.Collections.Generic;
21 using System.Reflection;
74 return reader.Read(reuse, dec);
87 private static IDictionary<string, Type> TypeName =
new Dictionary<string, Type>();
111 return base.ReadRecord(reuse, writerSchema, readerSchema, dec);
115 foreach (
Field wf
in writerSchema)
120 if (rs.TryGetField(wf.
Name, out rf))
122 obj = rec.Get(rf.Pos);
134 var defaultStream =
new MemoryStream();
137 foreach (
Field rf
in rs)
139 if (writerSchema.Contains(rf.
Name))
continue;
141 defaultStream.Position = 0;
143 defaultStream.Flush();
144 defaultStream.Position = 0;
146 obj = rec.Get(rf.
Pos);
168 throw new AvroException(
"Size mismatch between reader and writer fixed schemas. Writer: " + writerSchema +
169 ", reader: " + readerSchema);
202 System.Collections.IList array;
205 array = reuse as System.Collections.IList;
207 throw new AvroException(
"array object does not implement non-generic IList");
217 for (
int j = 0; j < n; j++, i++)
235 System.Collections.IDictionary map;
238 map = reuse as System.Collections.IDictionary;
240 throw new AvroException(
"map object does not implement non-generic IList");
249 for (
int j = 0; j < n; j++)
267 string type =
Avro.
CodeGen.getType(schema,
false, ref nEnum);
270 type = type.Remove(0, 6);
271 type = type.Remove(type.Length - 1);
275 type = type.Remove(0, 19);
276 type = type.Remove(type.Length - 1);
virtual void Skip(Schema writerSchema, Decoder d)
Reader wrapper class for reading data and storing into specific classes
override object ReadRecord(object reuse, RecordSchema writerSchema, Schema readerSchema, Decoder dec)
Deserializes a record from the stream.
int ReadEnum()
Reads an enum AvroType
Schema Schema
Field type's schema
Class for fields defined in a record
SpecificDefaultReader(Schema writerSchema, Schema readerSchema)
Constructor
override object ReadEnum(object reuse, EnumSchema writerSchema, Schema readerSchema, Decoder dec)
Reads an enum from the given decoder
string ReadString()
Reads a string Avro type
Class for enum type schemas
Schema ValueSchema
Schema for map values type
The default implementation for the generic reader.
int Pos
Position of the field within its record.
T Read(T reuse, Decoder dec)
Generic read function
Base class for all schema types
override string Name
Name of the schema
readonly string Name
Name of the field.
Interface class for generated classes
Reader class for reading data and storing into specific classes
Type
Enum for schema types
int Size
Fixed size for the bytes
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
int Ordinal(string symbol)
Returns the position of the given symbol within this enum.
long ReadArrayStart()
Starts reading the array Avro type.
long ReadArrayNext()
See ReadArrayStart().
object Read(object reuse, Schema writerSchema, Schema readerSchema, Decoder d)
Decoder is used to decode Avro data on a stream.
Base class for all generated classes
Class for array type schemas
SpecificReader(Schema writerSchema, Schema readerSchema)
Constructs a generic reader for the given schemas using the DefaultReader.
static void EncodeDefaultValue(Encoder enc, Schema schema, JToken jtok)
Reads the passed JToken default value field and writes it in the specified encoder
JToken DefaultValue
The default value for the field stored as JSON object, if defined.
override object ReadArray(object reuse, ArraySchema writerSchema, Schema readerSchema, Decoder dec)
Reads an array from the given decoder
object New(string name, Schema.Type schemaType)
Creates new instance of the given type
void ReadFixed(byte[] buffer)
A convenience method for ReadFixed(buffer, 0, buffer.Length);
Schema(Type type, PropertyMap props)
Constructor for schema class
virtual string getTargetType(Schema schema)
Gets the target type name in the given schema
static ObjectCreator Instance
long ReadMapNext()
See ReadMapStart().
override object ReadMap(object reuse, MapSchema writerSchema, Schema readerSchema, Decoder d)
Deserialized an avro map.
long ReadMapStart()
Starts reading the map Avro type.
Schema ItemSchema
Schema for the array 'type' attribute
string Fullname
Namespace.Name of the schema
Type Tag
Schema type property
override object ReadFixed(object reuse, FixedSchema writerSchema, Schema readerSchema, Decoder d)
Deserializes a fixed object and returns the object.
Schema WriterSchema
Schema for the writer class
Schema ReaderSchema
Schema for the reader class
SpecificReader(SpecificDefaultReader reader)
Decoder for Avro binary format