brendan-duncan / archive

Dart library to encode and decode various archive and compression formats, such as Zip, Tar, GZip, ZLib, and BZip2.
MIT License
400 stars 140 forks source link

tar.gz large content #340

Open miguelmcorreia opened 3 months ago

miguelmcorreia commented 3 months ago

Hi, need some help here. I am doing tests on my tar.gz decoder and it fails for large files.

I have turning around this and haven't gotten a solution. I know the tarball is a folder structure that has a json file in it, and i want to manipulate the json file in memory.

void decode(List<int> bytes) {
  final archive = TarDecoder().decodeBytes(GZipDecoder().decodeBytes(bytes));

  archive
    .where((entry) => entry.name.endsWith('json'))
    .toList()
    .forEach((element) {
        final content = element.content as List<int>;
    })
}

doing this i check the content length and it is 0. Is it the problem of the size of the file? Is there a way to stream it?