Exemple #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);
        }
Exemple #2
0
 public override bool Equals(object obj)
 {
     if (this == obj)
     {
         return(true);
     }
     if (obj != null && obj is GenericFixed)
     {
         GenericFixed that = obj as GenericFixed;
         if (that.Schema.Equals(this.Schema))
         {
             for (int i = 0; i < value.Length; i++)
             {
                 if (this.value[i] != that.value[i])
                 {
                     return(false);
                 }
             }
             return(true);
         }
     }
     return(false);
 }