Cannot Zip large file
Opened this issue · 2 comments
duchieupham commented
I'm facing with zipping large file on windows OS and MacOS.
If I have a zip file larger than 2Gb, my application crashes when starting zip process.
If I have a file large than 2Gb, the zip process seems to have errors. My zip file has just 75-80 bytes size.
brendan-duncan commented
You can try using an InputFileStream with the ZipDecoder.
import 'package:archive/archive_io.dart';
void main() {
var stream = InputFileStream('large_zip_file.zip');
var zip = ZipDecoder().decodeBuffer(stream);
for (var file in zip.files) {
var fileData = file.content;
// do something with the file data
file.clear(); // clear the memory
}
}
numnandkishore commented
Hello @brendan-duncan
Is the above code will be used for ZIPPING or UNZIPP
I have tried to ZIP file of size 1.63GB
I am getting below error
Exhausted heap space, trying to allocate 1629274320 bytes.
[VERBOSE-2:ui_dart_state.cc(198)] Unhandled Exception: Out of Memory