public void Serialize(BinaryWriter writer, object instance) { SerializationContext context = new SerializationContext(this, writer); context.MarkFixedInstances(this.FixedInstances); context.Mark(instance); context.Scan(); context.ScanTypes(); context.Write(); context.WriteObjectID(instance); }