• Post Reply Bookmark Topic Watch Topic
  • New Topic

Compressed v Uncompressed byte reading

 
sam wootton
Ranch Hand
Posts: 94
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Compressed v Uncompressed byte reading

Hi,

Thanks in advance for any help / advice. Its very much appreciated.

I am iterating over a collection of ZipEntry objects.

First thing i do is get the uncompressed file size of each ZipEntry:



Then i actually extract / read from each entry:



... the problem is that the bytesTotal is nearly always 1/2 of "contentLength".

e.g. output stops at:



I guess this is because i am comparing compressed file sizes with uncompressed file sizes?

If i divide contentLength / 2, it kind of works.

But i dont know what i should be comparing, compressed 'v' uncompressed file sizes / bytes?

Best regards, snapple
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sam wootton wrote:
First thing i do is get the uncompressed file size of each ZipEntry:




No, that's not what that code does. Look more closely.
 
sam wootton
Ranch Hand
Posts: 94
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeff Verdegan,

... ok then, compressed size. It should be compressed size, because i am comparing it to the overall size of the zip file?

I still have the same problem. It was just a typo in my post :]

Best regards, snapple
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!