- String sourcefilename = FILETOBEUNCOMPRESSED;
- Filestream sourcefile = File.OpenRead(sourcefilename);
- Filestream destinationfile = File.Create(outputfilename);
- DeflateStream compressionstream = new DeflateStream(sourcefile, CompressionMode.Decompress);
- int sourcebyte = compressionstream.ReadByte();
- while(sourcebyte != -1)
- {
- destinationfile.WriteByte((byte)sourcebyte);
- sourcebyte = compressionstream.ReadByte();
- }
- //该片段来自于http://www.codesnippet.cn/detail/220820135287.html
来源: http://www.codesnippet.cn/detail/220820135287.html