Esempio n. 1
0
        protected override string DecompressAll(Stream FileList, Stream CompressedStream)
        {
            var sfs     = new SparseFileWriterStream(FileList);
            var buffer  = new byte[5];
            var decoder = new Decoder();

            CompressedStream.Read(buffer, 0, 5);
            decoder.SetDecoderProperties(buffer);
            try
            {
                decoder.Code(CompressedStream, sfs, CompressedStream.Length - CompressedStream.Position, sfs.Length, null);
            }
            finally
            {
                sfs.Close();
            }
            return(sfs.GetBaseDirectory());
        }
Esempio n. 2
0
        protected override string DecompressAll(Stream fileList, Stream compressedStream)
        {
            var sfs = new SparseFileWriterStream(fileList);

            using (var zip = new ZipFile(compressedStream))
            {
                var    file   = zip.GetInputStream(0);
                byte[] buffer = new byte[4096];
                int    i;

                while ((i = file.Read(buffer, 0, 4096)) > 0)
                {
                    sfs.Write(buffer, 0, i);
                }

                sfs.Close();
            }

            return(sfs.BaseDirectory);
        }