all groups > dotnet windows forms > january 2008 >
You're in the

dotnet windows forms

group:

GZipStream give error Arithmetic operation resulted in an overflow.(more then 3 GB file)


Re: GZipStream give error Arithmetic operation resulted in an overflow.(more then 3 GB file) Kevin Spencer
1/29/2008 7:45:59 AM
dotnet windows forms:
Try reading the file in chunks instead of all at once.

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP

[quoted text, click to view]

GZipStream give error Arithmetic operation resulted in an overflow.(more then 3 GB file) harshad
1/29/2008 3:50:07 PM
Dear All,

I use System.IO.Compression namespace for compressing file
give me overflow for streamObj.Length when file size more then 3 GB.

following my code:


Dim streamObj As Stream = File.OpenRead(GZipFileName)
Dim buffer(streamObj.Length) As Byte

streamObj.Read(buffer, 0, buffer.Length)
streamObj.Close()

Dim compFile As System.IO.FileStream =
File.Create((Path.ChangeExtension(GZipFileName, "GZip")))
Dim zipStreamObj As New GZipStream(compFile,
CompressionMode.Compress)

zipStreamObj.Write(buffer, 0, buffer.Length)
zipStreamObj.Close()


Thanks,

Harshad

AddThis Social Bookmark Button