Exemplo n.º 1
0
        protected override void WriteFixed(FixedSchema es, object value, Encoder encoder)
        {
            if (value == null || !(value is GenericFixed) || !(value as GenericFixed).Schema.Equals(es))
            {
                throw TypeMismatch(value, "fixed", "GenericFixed");
            }
            GenericFixed ba = (GenericFixed)value;

            encoder.WriteFixed(ba.Value);
        }
        protected override void WriteFixed(FixedSchema schema, object value, Encoder encoder)
        {
            var fixedrec = value as SpecificFixed;

            if (fixedrec == null)
            {
                throw new AvroTypeException("Fixed object is not derived from SpecificFixed");
            }

            encoder.WriteFixed(fixedrec.Value);
        }