19 using System.Collections.Generic;
62 foreach (
Field field
in schema)
115 var arr = value as System.Collections.IList;
122 for (
int i = 0; i < l; i++)
138 var map = value as System.Collections.IDictionary;
144 foreach (System.Collections.DictionaryEntry de in map)
163 for (
int i = 0; i < us.
Count; i++)
168 Write(us[i], value, encoder);
172 throw new AvroException(
"Cannot find a match for " + value.GetType() +
" in " + us);
191 return obj is double;
193 return obj is
byte[];
195 return obj is string;
201 return obj.GetType().IsEnum && (sc as
EnumSchema).Symbols.Contains(obj.ToString());
203 return obj is System.Collections.IList;
205 return obj is System.Collections.IDictionary;
Schema Schema
Field type's schema
Class for fields defined in a record
override void WriteUnion(UnionSchema us, object value, Encoder encoder)
Resolves the given value against the given UnionSchema and serializes the object against the resolved...
Generic wrapper class for writing data from specific objects
Class for enum type schemas
Schema ValueSchema
Schema for map values type
int Pos
Position of the field within its record.
Base class for all schema types
override void WriteRecord(RecordSchema schema, object value, Encoder encoder)
Serialized a record using the given RecordSchema.
void SetItemCount(long value)
override void WriteEnum(EnumSchema schema, object value, Encoder encoder)
Writes the given enum value into the given encoder.
readonly string Name
Name of the field.
SpecificWriter(Schema schema)
A General purpose writer for serializing objects into a Stream using Avro.
Interface class for generated classes
Type
Enum for schema types
override void WriteMap(MapSchema schema, object value, Encoder encoder)
Writes the given map into the given encoder.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
override bool Matches(Schema sc, object obj)
int Ordinal(string symbol)
Returns the position of the given symbol within this enum.
Class to store schema name, namespace and enclosing namespace
SpecificDefaultWriter(Schema schema)
Constructor
virtual void Write(Schema schema, object value, Encoder encoder)
Examines the schema and dispatches the actual work to one of the other methods of this class.
void WriteEnum(int value)
void WriteFixed(byte[] data)
Base class for all generated classes
Class for array type schemas
override void WriteArray(ArraySchema schema, object value, Encoder encoder)
Serialized an array.
override bool Equals(Object obj)
Compares two schema names
SpecificWriter(SpecificDefaultWriter writer)
A typesafe wrapper around DefaultWriter.
void WriteUnionIndex(int value)
int Count
Count of schemas in the union
void WriteString(string value)
Schema ItemSchema
Schema for the array 'type' attribute
Class for writing data from any specific objects
Type Tag
Schema type property
override void WriteFixed(FixedSchema schema, object value, Encoder encoder)
Validates that the record is a fixed record object and that the schema in the object is the same as t...