Esempio n. 1
0
        /// <summary>
        /// Serializes the specified formatter.
        /// </summary>
        /// <param name="formatter">The formatter.</param>
        /// <param name="stream">The stream.</param>
        /// <param name="items">The items.</param>
        /// <param name="additionalInfo">The additional information.</param>
        public static void Serialize(FastBinaryFormatter formatter, Stream stream, IEnumerable <T> items, object additionalInfo)
        {
            var serializer = new FastSerializerEnumerable <T>(items);

            formatter.Serialize(stream, serializer, additionalInfo);
        }
Esempio n. 2
0
        /// <summary>
        /// Serializes the specified formatter.
        /// </summary>
        /// <param name="formatter">The formatter.</param>
        /// <param name="items">The items.</param>
        /// <param name="additionalInfo">The additional information.</param>
        /// <returns></returns>
        public static byte[] Serialize(FastBinaryFormatter formatter, IEnumerable <T> items, object additionalInfo)
        {
            var serializer = new FastSerializerEnumerable <T>(items);

            return(formatter.Serialize(serializer, additionalInfo));
        }