TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Don
NA
1
2.1k
About Compressing using GZipStream
Feb 14 2007 9:35 AM
hi guys .. , I have the following code from book MCTS 70-536 ( Self paced training kit by Mcft Press) Microsoft .NET 2.0 Application Development Foundation .. In lesson 3 "Compressing Streams " of Chapter 2 Input/Output .... using System; using System.Collections.Generic; using System.Text; using System.IO; using System.IO.Compression; namespace CompressDe { class Program { static void Main(string[] args) { FileStream sourceFile = File.OpenRead(@"C:\anyFile.txt"); FileStream destFile = File.Create(@"C:\anyFile.txt.gz"); GZipStream compStream = new GZipStream(destFile, CompressionMode.Compress); int theByte = sourceFile.ReadByte(); while (theByte != -1) { compStream.WriteByte((byte)theByte); theByte = sourceFile.ReadByte(); } } } The problem with the following code is that the Size of the Compressed File comes out to be larger than the original file .... then what is the profit of compressing the file . . Edit/Delete Message
Reply
Answers (
0
)
writing string to registry at installation time
Problem in FileSystemWatcher class