• Post Reply Bookmark Topic Watch Topic
  • New Topic

Zipped file size is larger then original file

 
hitesh s kushwaha
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a problem in zipping files although program is running fine but as i zip the file the size of the file in zipped folder is larger then the actual file .
I dont know what actually is the problem please help me out

Below is my code.






Thanks in advance
 
Joe Ess
Bartender
Posts: 9361
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.util.zip.ZipOutputStream:

STORED
public static final int STORED
Compression method for uncompressed (STORED) entries.
 
hitesh s kushwaha
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply

Yes i know
STORED
is for uncompressed zip bt how can an uncompressed zip file be larger in size den original file
 
Paul Clapham
Sheriff
Posts: 21867
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because it contains the original file, uncompressed in your case, plus some more bytes which constitute the zip file's framework. Headers, directory entries, whatever they might be.
 
hitesh s kushwaha
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok so how can i remove those extra bytes because i want the original and uncompressed zip file
 
Paul Clapham
Sheriff
Posts: 21867
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First you put a television set into a box, and asked why the box was bigger than the television set. This was explained correctly, I hope. Now you want to get the television set back. The answer is, you take it out of the box.

Or am I the one who is completely misunderstanding this thread?
 
hitesh s kushwaha
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the reply.
but i dont want to take it out of the box .
but instead i want to zip dat file in uncompressed manner but i dont want those extra bytes to be added because i have a tool which uses zip uncompressed files to display certain images for that i need the must be zipped and must have original content nothing other den that please help.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ZIP files will always have the extra information - that's what makes them ZIP files. You can read up on the details of that extra information on the Wikipedia page.

If the tool reads ZIP files, then it will need that extra information as well.
 
hitesh s kushwaha
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But when i make uncompressed zip using winzip file does not contain any extra character and the tool seems to read that.

and when i zip the file with my program the file adds some extra characters because of that tool is not reading the file.

or if winzip has its own character set to be encoded with every file den if there any way i can use winzip in my program with all functionality....

 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hitesh s kushwaha wrote:But when i make uncompressed zip using winzip file does not contain any extra character and the tool seems to read that.

and when i zip the file with my program the file adds some extra characters because of that tool is not reading the file.

or if winzip has its own character set to be encoded with every file den if there any way i can use winzip in my program with all functionality....



I can only assume that the OP is a Troll since he persists in saying that winzip does not add characters (by this I assume he means bytes) both in this thread and in http://forums.sun.com/thread.jspa?threadID=5405775&messageID=10808619#10808619 .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!