示例#1
0
        internal static IFileStreamWrap[] ConvertFileStreamArrayIntoIFileStreamWrapArray(FileStream[] fileStreams)
        {
            var fileStreamWraps = new FileStreamWrap[fileStreams.Length];

            for (int i = 0; i < fileStreams.Length; i++)
            {
                fileStreamWraps[i] = new FileStreamWrap(fileStreams[i]);
            }
            return(fileStreamWraps);
        }
        /// <summary>
        /// Creates a file with the content from the given stream.
        /// </summary>
        /// <param name="streamReader">input stream</param>
        /// <param name="filePath">the file path where the output is written to.</param>
        public void CreateFileFromStream(IStreamReader streamReader, string filePath)
        {
            if (streamReader == null || streamReader.BaseStream == null || streamReader.BaseStream.Length <= 0)
            {
                return;
            }

            using (var fileStreamWrap = new FileStreamWrap(filePath, FileMode.Create, FileAccess.Write))
            {
                fileStreamWrap.CopyFromStream(streamReader.BaseStream);
            }
        }
示例#3
0
 internal static IFileStreamWrap[] ConvertFileStreamArrayIntoIFileStreamWrapArray(FileStream[] fileStreams)
 {
     var fileStreamWraps = new FileStreamWrap[fileStreams.Length];
     for (int i = 0; i < fileStreams.Length; i++)
         fileStreamWraps[i] = new FileStreamWrap(fileStreams[i]);
     return fileStreamWraps;
 }