/// <summary> /// 创建新文件流对象 /// </summary> /// <param name="zipInputStream">文件流</param> /// <returns>新文件流对象</returns> private Stream CopyStream(Stream stream) { MemoryStream memstream = new MemoryStream(); byte[] buffer = new byte[4096]; int size = 4096; while (true) { size = stream.Read(buffer, 0, buffer.Length); if (size > 0) { memstream.Write(buffer, 0, size); } else { break; } } return memstream; }