求助,ICSharpCode.SharpZipLib.Zip 如何进行分段压缩.
using (fs = new FileStream(file, FileMode.Open, FileAccess.ReadWrite))
{
byte[] bytes = new byte[fs.Length];
}
//fs.Length 为863571036 是一个800多M的文件.
//引发异常信息 :System.OutOfMemoryException
后来 ,我分段读取,每次读取一点.seek .
但是 我用的是 ICSharpCode.SharpZipLib.Zip; 该dll来进行压缩.
ZipOutputStream s= new ZipOutputStream(File.Create());
ZipEntry entry = new ZipEntry(tempfile);
entry.DateTime = DateTime.Now;
entry.Size = filesSize;
crc.Reset();
crc.Update(bytes);
entry.Crc = crc.Value;
s.PutNextEntry(entry);
s.Write(bytes, 0, bytes.Length);
文件流可以分段读取 ,但是压缩 ZipOutputStream 该类中的seek 不能使用,提示我默认不支持.
不能进行分段压缩.如果哪位知道ZipOutputStream 可以尽心分段压缩 ,请贴上代码给我 ..谢谢.