Python bz2 uncompressed file size

后端 未结 3 1588
余生分开走
余生分开走 2020-12-20 01:26

I am using Python 2.7. I have a .bz2 file, and I need to figure out the uncompressed file size of its component file without actually decompressing it. I have found ways to

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-20 02:11

    I suspect this is impossible due to the nature of bz2 format and compressing techniques it uses. Here is a quite good description of the both format and the algorithms http://en.wikipedia.org/wiki/Bzip2#File_format

    You will never know original data size until you decompress it.

提交回复
热议问题