getting uncompressed file size from GZIPInputStream

J

Jim Schlemmer

I'm trying to figure out if there's some way to determine the
uncompressed size of a gzip'd file. Perhaps it's not knowable in
advance?

-jim
 
M

Michael Borgwardt

Jim said:
I'm trying to figure out if there's some way to determine the
uncompressed size of a gzip'd file. Perhaps it's not knowable in
advance?

Indeed it isn't, since gzip works on streams unlike zip, which
works on files and uses an index.
 
L

Liz

Jim Schlemmer said:
I'm trying to figure out if there's some way to determine the
uncompressed size of a gzip'd file. Perhaps it's not knowable in
advance?

-jim

C:\>gzip -l format1data.xml.gz
compressed uncompr. ratio uncompressed_name
1501 14678 89.8% format1data.xml
 
M

Michael Borgwardt

Liz said:
C:\>gzip -l format1data.xml.gz
compressed uncompr. ratio uncompressed_name
1501 14678 89.8% format1data.xml

I'm pretty sure that what this does is simply to uncompress the file
and look at the result, i.e. not what Jim wanted.
 
L

Liz

Michael Borgwardt said:
I'm pretty sure that what this does is simply to uncompress the file
and look at the result, i.e. not what Jim wanted.

You did not put any restrictions on HOW to do it. Are
there any other requirements like speed?
 
M

Michael Borgwardt

Liz said:
You did not put any restrictions on HOW to do it.

He said "Perhaps it's not knowable in advance?", which means to me
"in advance of decompressing" and suggests that he he wants just that.
 
J

Josef Garvi

Michael said:
He said "Perhaps it's not knowable in advance?", which means to me
"in advance of decompressing" and suggests that he he wants just that.

Like for example wanting to know if there is sufficient disk space before
decompressing a huge file.

--
Josef Garvi

"Reversing desertification through drought tolerant trees"
http://www.eden-foundation.org/

new income - better environment - more food - less poverty
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top