C# 字节流输出文件


  #region 字节流输出文件
        /// 
        /// 字节流输出文件
        /// 
        /// 输出路径
        /// 文件的字节数组
        public static void SaveFile(string outPath,byte[] buffer)
        {
            try
            {
                using (FileStream fileStream=new FileStream(outPath,FileMode.OpenOrCreate,FileAccess.Write))
                {
                    fileStream.Write(buffer,0,buffer.Length);
                }
            }
            catch (Exception ex)
            {
                WriteLog.WriteErrorInfo(ex);
            }
        }
        #endregion

相关