示例#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);
     }
 }
示例#2
0
        private void Skip(IEnumerable <RarFilePart> parts)
        {
            var buffer = new byte[4096];

            using (Stream s = new MultiVolumeStream(parts, listener))
            {
                while (s.Read(buffer, 0, buffer.Length) > 0)
                {
                }
            }
        }
        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());
            }
        }
示例#5
0
 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);
     }
 }
示例#6
0
 private void Skip(IEnumerable<RarFilePart> parts)
 {
     var buffer = new byte[4096];
     using (Stream s = new MultiVolumeStream(parts, listener))
     {
         while (s.Read(buffer, 0, buffer.Length) > 0)
         {
         }
     }
 }