Using #ZipLib, I'm zipping up large files (100MB & >). I'm using a byte
array to read in the file and write out to the zip file. The bigger the
chunks I can read in the faster the zipping goes. What's the best way
to determine how big I can make the byte array? I'm guessing that I
would determine the amount of available memory and take a percentage of
that?
OR: does anyone have any code using #ZipLib that demonstrates how to zip
files of any size?
The error I'm getting is:
Insufficient system resources exist to complete the requested service.
Here's the code I'm using:
dim buffer(33554432) as Byte '32MB Buffer
While fs.Position < fs.Length
If (fs.Position + 33554432) < fs.Length Then
fs.Read(buffer, 0, buffer.Length)
s.Write(buffer, 0, buffer.Length)
Else
Dim rdlen As Long = fs.Length - fs.Position
fs.Read(buffer, 0, rdlen)
s.Write(buffer, 0, rdlen)
End If
End While
*** Sent via Developersdex http://www.developersdex.com ***