public DeflateStream(Stream stream, CompressionMode mode,
                      Leayal.PSO2.Updater.CompressionLevel level = Leayal.PSO2.Updater.CompressionLevel.Default,
                      bool leaveOpen         = false,
                      Encoding forceEncoding = null)
 {
     _baseStream = new ZlibBaseStream(stream, mode, level, ZlibStreamFlavor.DEFLATE, leaveOpen, forceEncoding);
 }
        public ZlibBaseStream(Stream stream,
                              CompressionMode compressionMode,
                              Leayal.PSO2.Updater.CompressionLevel level,
                              ZlibStreamFlavor flavor,
                              bool leaveOpen,
                              Encoding encoding)
        {
            _flushMode = FlushType.None;

            //this._workingBuffer = new byte[WORKING_BUFFER_SIZE_DEFAULT];
            _stream          = stream;
            _leaveOpen       = leaveOpen;
            _compressionMode = compressionMode;
            _flavor          = flavor;
            _level           = level;

            _encoding = encoding;

            // workitem 7159
            if (flavor == ZlibStreamFlavor.GZIP)
            {
                crc = new CRC32();
            }
        }
Example #3
0
 public ZlibStream(Stream stream, CompressionMode mode, Leayal.PSO2.Updater.CompressionLevel level, bool leaveOpen, Encoding encoding)
 {
     _baseStream = new ZlibBaseStream(stream, mode, level, ZlibStreamFlavor.ZLIB, leaveOpen, encoding);
 }
Example #4
0
 public ZlibStream(Stream stream, CompressionMode mode, Leayal.PSO2.Updater.CompressionLevel level)
     : this(stream, mode, level, false, Encoding.UTF8)
 {
 }