Ejemplo n.º 1
0
        /// <summary>
        /// </summary>
        /// <inheritdoc/>
        /// <returns>The input files as source</returns>
        public override IEnumerable <IInputSource> Shards()
        {
            var source = new InMemorySource(Content);

            source.SetFormatter(Formatter);
            source._cachedInstance = _cachedInstance;
            yield return(source);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new filesource
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="formatter"></param>
        /// <returns></returns>
        public static InMemorySource Create <T>(Stream payload, IInputFormatter <T> formatter = null)
            where T : class
        {
            var src = new InMemorySource(payload);

            src.SetFormatter(formatter);
            return(src);
        }