IReader.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.IO;
  3. using SharpCompress.Common;
  4. namespace SharpCompress.Readers
  5. {
  6. public interface IReader : IDisposable
  7. {
  8. event EventHandler<ReaderExtractionEventArgs<IEntry>> EntryExtractionProgress;
  9. event EventHandler<CompressedBytesReadEventArgs> CompressedBytesRead;
  10. event EventHandler<FilePartExtractionBeginEventArgs> FilePartExtractionBegin;
  11. ArchiveType ArchiveType { get; }
  12. IEntry Entry { get; }
  13. /// <summary>
  14. /// Decompresses the current entry to the stream. This cannot be called twice for the current entry.
  15. /// </summary>
  16. /// <param name="writableStream"></param>
  17. void WriteEntryTo(Stream writableStream);
  18. bool Cancelled { get; }
  19. void
  20. Cancel();
  21. /// <summary>
  22. /// Moves to the next entry by reading more data from the underlying stream. This skips if data has not been read.
  23. /// </summary>
  24. /// <returns></returns>
  25. bool MoveToNextEntry();
  26. /// <summary>
  27. /// Opens the current entry as a stream that will decompress as it is read.
  28. /// Read the entire stream or use SkipEntry on EntryStream.
  29. /// </summary>
  30. EntryStream OpenEntryStream();
  31. }
  32. }