ZipWriterOptions.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using SharpCompress.Archives;
  2. using SharpCompress.Common;
  3. using SharpCompress.Compressors.Deflate;
  4. namespace SharpCompress.Writers.Zip
  5. {
  6. public class ZipWriterOptions : WriterOptions
  7. {
  8. public ZipWriterOptions(CompressionType compressionType)
  9. : base(compressionType)
  10. {
  11. }
  12. internal ZipWriterOptions(WriterOptions options)
  13. : base(options.CompressionType)
  14. {
  15. LeaveStreamOpen = options.LeaveStreamOpen;
  16. ArchiveEncoding = options.ArchiveEncoding;
  17. var writerOptions = options as ZipWriterOptions;
  18. if (writerOptions != null)
  19. {
  20. UseZip64 = writerOptions.UseZip64;
  21. DeflateCompressionLevel = writerOptions.DeflateCompressionLevel;
  22. ArchiveComment = writerOptions.ArchiveComment;
  23. }
  24. }
  25. /// <summary>
  26. /// When CompressionType.Deflate is used, this property is referenced. Defaults to CompressionLevel.Default.
  27. /// </summary>
  28. public CompressionLevel DeflateCompressionLevel { get; set; } = CompressionLevel.Default;
  29. public string ArchiveComment { get; set; }
  30. /// <summary>
  31. /// Sets a value indicating if zip64 support is enabled.
  32. /// If this is not set, individual stream lengths cannot exceed 4 GiB.
  33. /// This option is not supported for non-seekable streams.
  34. /// Archives larger than 4GiB are supported as long as all streams
  35. /// are less than 4GiB in length.
  36. /// </summary>
  37. public bool UseZip64 { get; set; }
  38. }
  39. }