File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes How to determine the size of a file... (zip) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How to determine the size of a file... (zip)" Watch "How to determine the size of a file... (zip)" New topic
Author

How to determine the size of a file... (zip)

Sumanth R Prasad
Greenhorn

Joined: Aug 14, 2003
Posts: 6
Hi !
Plz lemme know if there's a way of determining the size of a zip file in bytes...
(can I use RandomAccessFile.length() for zip files?)
Thanx in advance
Sumanth
jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
Using a regular File object will do the trick, I believe.
Alex Radomski
Greenhorn

Joined: Apr 24, 2003
Posts: 24
Plz lemme know if there's a way of determining the size of a zip file in bytes...
(can I use RandomAccessFile.length() for zip files?)

java.util.zip.ZipEntry has getCompressedSize()
 
Consider Paul's rocket mass heater.
 
subject: How to determine the size of a file... (zip)
 
Similar Threads
ZipOutputStream creates corrupted files when bigger than 4gb
Strange problem??
How to locate & write to files inside a Jar
Configuration of Jboss in Eclipse
UnZIPPing Exception