internal BBitSetXmlSerializer Reset(BBitSetXmlParams @params, Collections.BBitSet bits)
        {
            Params = @params;
            Bits   = bits;

            return(this);
        }
        public static void Serialize <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s,
                                                     Collections.BBitSet bits, BBitSetXmlParams @params)
            where TDoc : class
            where TCursor : class
        {
            Contract.Requires(s != null);
            Contract.Requires(bits != null);
            Contract.Requires(@params != null);
            Contract.Requires(@params.UseElementName || @params.ElementItselfMeansTrue,
                              "Collection only supports element name filtering");

            if (gBitSetXmlSerializer == null)
            {
                gBitSetXmlSerializer = new BBitSetXmlSerializer();
            }
            var xs = gBitSetXmlSerializer;

            using (xs.Reset(@params, bits))
            {
                xs.Serialize(s);
            }
        }