mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-09-24 16:05:27 +00:00
Add WriterOptions.BufferSize property
This commit is contained in:
@@ -92,7 +92,8 @@ using (var archive = GZipArchive.CreateArchive())
|
||||
// With fluent options (preferred)
|
||||
var options = WriterOptions.ForZip()
|
||||
.WithCompressionLevel(9)
|
||||
.WithLeaveStreamOpen(false);
|
||||
.WithLeaveStreamOpen(false)
|
||||
.WithBufferSize(131072);
|
||||
using (var archive = ZipArchive.CreateArchive())
|
||||
{
|
||||
archive.SaveTo("output.zip", options);
|
||||
@@ -102,10 +103,13 @@ using (var archive = ZipArchive.CreateArchive())
|
||||
var options2 = new WriterOptions(CompressionType.Deflate)
|
||||
{
|
||||
CompressionLevel = 9,
|
||||
LeaveStreamOpen = false
|
||||
LeaveStreamOpen = false,
|
||||
BufferSize = 131072
|
||||
};
|
||||
```
|
||||
|
||||
`WriterOptions.BufferSize` controls stream copy buffers used while writing archive entries. If it is not set, SharpCompress falls back to `Constants.BufferSize`.
|
||||
|
||||
---
|
||||
|
||||
## Archive API Methods
|
||||
|
||||
Reference in New Issue
Block a user