예제 #1
0
        private void SetDeflateStreamFileFormatter(CompressionMode mode) {

            if (mode == CompressionMode.Compress) {

                IFileFormatWriter writeCommand = new GZipFormatter();
                deflateStream.SetFileFormatWriter(writeCommand);

            } else {

                IFileFormatReader readCommand = new GZipDecoder();
                deflateStream.SetFileFormatReader(readCommand);
            }
        }
예제 #2
0
파일: GZipStream.cs 프로젝트: ujjwol/corefx
 private void SetDeflateStreamFileFormatter(CompressionMode mode)
 {
     if (mode == CompressionMode.Compress)
     {
         IFileFormatWriter writeCommand = new GZipFormatter();
         _deflateStream.SetFileFormatWriter(writeCommand);
     }
     else
     {
         IFileFormatReader readCommand = new GZipDecoder();
         _deflateStream.SetFileFormatReader(readCommand);
     }
 }
예제 #3
0
 public GZipStream(Stream stream, CompressionMode mode, bool leaveOpen)
 {
     this.deflateStream = new DeflateStream(stream, mode, leaveOpen);
     if (mode == CompressionMode.Compress)
     {
         IFileFormatWriter writer = new GZipFormatter();
         this.deflateStream.SetFileFormatWriter(writer);
     }
     else
     {
         IFileFormatReader reader = new GZipDecoder();
         this.deflateStream.SetFileFormatReader(reader);
     }
 }
 public GZipStream(Stream stream, CompressionMode mode, bool leaveOpen)
 {
     this.deflateStream = new DeflateStream(stream, mode, leaveOpen);
     if (mode == CompressionMode.Compress)
     {
         IFileFormatWriter writer = new GZipFormatter();
         this.deflateStream.SetFileFormatWriter(writer);
     }
     else
     {
         IFileFormatReader reader = new GZipDecoder();
         this.deflateStream.SetFileFormatReader(reader);
     }
 }