Exemple #1
0
 private void Write(IEnumerable <RarFilePart> parts, Stream writeStream, CancellationToken cancellation)
 {
     using (Stream input = new MultiVolumeStream(parts, listener))
     {
         var pack = new Unpack.Unpack(Entry.FileHeader, input, writeStream);
         pack.doUnpack(Entry.IsSolid, cancellation);
     }
 }
        public void WriteTo(Stream streamToWriteTo, IRarExtractionListener listener)
        {
            if (IsEncrypted)
            {
                throw new RarExtractionException("Entry is password protected and cannot be extracted.");
            }

            if (IsDirectory)
            {
                throw new RarExtractionException("Entry is a file directory and cannot be extracted.");
            }

            listener.CheckNotNull("listener");
            listener.OnFileEntryExtractionInitialized(FilePath, CompressedSize);
            using (Stream input = new MultiVolumeStream(parts, listener))
            {
                var pack = new Unpack.Unpack(FileHeader, input, streamToWriteTo);
                pack.doUnpack(Archive.IsSolidArchive());
            }
        }
        public void WriteTo(Stream streamToWriteTo, IRarExtractionListener listener)
        {
            if (IsEncrypted)
            {
                throw new RarExtractionException("Entry is password protected and cannot be extracted.");
            }

            if (IsDirectory)
            {
                throw new RarExtractionException("Entry is a file directory and cannot be extracted.");
            }

            listener.CheckNotNull("listener");
            listener.OnFileEntryExtractionInitialized(FilePath, CompressedSize);
            using (Stream input = new MultiVolumeStream(parts, listener))
            {
                var pack = new Unpack.Unpack(FileHeader, input, streamToWriteTo);
                pack.doUnpack(Archive.IsSolidArchive());
            }
        }
 private void Write(IEnumerable<RarFilePart> parts, Stream writeStream)
 {
     using (Stream input = new MultiVolumeStream(parts, listener))
     {
         var pack = new Unpack.Unpack(Entry.FileHeader, input, writeStream);
         pack.doUnpack(Entry.IsSolid);
     }
 }