Example #1
0
        /// <summary>
        ///     Creates a string pickle out of a given value.
        /// </summary>
        /// <typeparam name="T">serialized value type.</typeparam>
        /// <param name="value">serialized value.</param>
        /// <param name="streamingContext">payload object for StreamingContext; defaults to null.</param>
        /// <returns>binary pickle for object.</returns>
        public string PickleToString <T>(T value, Object streamingContext = null)
        {
            var sc = Utils.GetStreamingContext(streamingContext);

            return(_textSerializer.PickleToString <T>(value, streamingContext: sc.ToOption()));
        }
Example #2
0
        /// <summary>
        ///     Creates a string pickle out of a given value.
        /// </summary>
        /// <typeparam name="T">serialized value type.</typeparam>
        /// <param name="value">serialized value.</param>
        /// <param name="streamingContext">payload object for StreamingContext; defaults to null.</param>
        /// <returns>binary pickle for object.</returns>
        public string PickleToString <T>(T value, Object streamingContext = null)
        {
            var sc = Utils.GetStreamingContext(streamingContext);

            return(_textPickler.PickleToString <T>(value, streamingContext: sc));
        }