ZipArchiveEntry.cs 689 B

123456789101112131415161718192021222324252627282930
  1. using System.IO;
  2. using System.Linq;
  3. using SharpCompress.Common.Zip;
  4. namespace SharpCompress.Archives.Zip
  5. {
  6. public class ZipArchiveEntry : ZipEntry, IArchiveEntry
  7. {
  8. internal ZipArchiveEntry(ZipArchive archive, SeekableZipFilePart part)
  9. : base(part)
  10. {
  11. Archive = archive;
  12. }
  13. public virtual Stream OpenEntryStream()
  14. {
  15. return Parts.Single().GetCompressedStream();
  16. }
  17. #region IArchiveEntry Members
  18. public IArchive Archive { get; }
  19. public bool IsComplete => true;
  20. #endregion
  21. public string Comment => (Parts.Single() as SeekableZipFilePart).Comment;
  22. }
  23. }