P
prince.matt
Hi,
I am using GZipStream to compress a simple text file approx 24MB in
size. I am finding that the destination "compressed" file is several
MB larger than the source file (31MB). The code is as follows:
Dim sourcefile As FileStream = File.OpenRead(inFileName)
Dim destFile As FileStream = File.Open(outFilename,
FileMode.Create, FileAccess.Write)
Dim compStream As New GZipStream(destFile,
CompressionMode.Compress)
Dim myByte As Integer = sourcefile.ReadByte()
While myByte <> -1
compStream.WriteByte(CType(myByte, Byte))
myByte = sourcefile.ReadByte()
End While
Any ideas why the compressed file actually ends up larger than the
source?
Thanks,
Matt
I am using GZipStream to compress a simple text file approx 24MB in
size. I am finding that the destination "compressed" file is several
MB larger than the source file (31MB). The code is as follows:
Dim sourcefile As FileStream = File.OpenRead(inFileName)
Dim destFile As FileStream = File.Open(outFilename,
FileMode.Create, FileAccess.Write)
Dim compStream As New GZipStream(destFile,
CompressionMode.Compress)
Dim myByte As Integer = sourcefile.ReadByte()
While myByte <> -1
compStream.WriteByte(CType(myByte, Byte))
myByte = sourcefile.ReadByte()
End While
Any ideas why the compressed file actually ends up larger than the
source?
Thanks,
Matt