#1 2020-02-14 13:42:56

domek
Member
Registered: 2019-04-09
Posts: 8

SynBzPas.pas and UnCompressBzMem - what is the unpacked size?

I want to use UnCompressBzMem() from SynBZPas.pas to unpack z .bz2 file. But in order to do so I need to know the last parameter:
DestSize: integer
so the size after unpacking. Where do I get this size from an actual .bz2 file?

Offline

#2 2020-02-15 11:22:20

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,201
Website

Re: SynBzPas.pas and UnCompressBzMem - what is the unpacked size?

I don't think it is allowed by the BZ encoding itself, IIRC.

You should store the uncompressed length somewhere - as we do with our TAlgoCompress wrappers.

Online

#3 2020-02-15 14:29:53

domek
Member
Registered: 2019-04-09
Posts: 8

Re: SynBzPas.pas and UnCompressBzMem - what is the unpacked size?

I just have a standard .bz2 file. So I can't unpack it? Somehow programs like 7zip and WinRAR can unpack this file.

Offline

#4 2020-02-19 12:41:39

jaclas
Member
Registered: 2014-09-12
Posts: 215

Re: SynBzPas.pas and UnCompressBzMem - what is the unpacked size?

Maybe uncompressed size is coded in first bytes of file? Try this.

Offline

#5 2020-02-20 21:19:11

domek
Member
Registered: 2019-04-09
Posts: 8

Re: SynBzPas.pas and UnCompressBzMem - what is the unpacked size?

Offline

#6 2020-02-22 06:35:08

uian2000
Member
Registered: 2014-05-06
Posts: 68

Re: SynBzPas.pas and UnCompressBzMem - what is the unpacked size?

According to the file format defination, we can not get that size before uncompress.

Offline

Board footer

Powered by FluxBB