The tar file format is quite simple, a 512 bytes header followed by the file contents also padded to a 512 boundary (see
Tar_(file_format)).
As you only have one file per archive...
- open the file with the corresponding :gzip layer
- read the header and extract the file size from there
- read lines taking care to remove the extra nulls from the last line on the file