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); }
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); }