Esempio n. 1
0
        public long WriteZipOutputStream()
        {
            using (var memoryStream = new MemoryStream(outputBuffer))
            {
                var zipOutputStream = new SharpZipLib.Zip.ZipOutputStream(memoryStream);
                zipOutputStream.PutNextEntry(new SharpZipLib.Zip.ZipEntry("0"));

                for (int i = 0; i < ChunkCount; i++)
                {
                    zipOutputStream.Write(inputBuffer, 0, inputBuffer.Length);
                }

                return(memoryStream.Position);
            }
        }
Esempio n. 2
0
        public ZipInputStream()
        {
            using (var memoryStream = new MemoryStream())
            {
                using (var zipOutputStream = new SharpZipLib.Zip.ZipOutputStream(memoryStream))
                {
                    zipOutputStream.PutNextEntry(new SharpZipLib.Zip.ZipEntry("0"));

                    var inputBuffer = new byte[ChunkSize];

                    for (int i = 0; i < ChunkCount; i++)
                    {
                        zipOutputStream.Write(inputBuffer, 0, inputBuffer.Length);
                    }
                }

                zippedData = memoryStream.ToArray();
            }
        }