aspose file tools*
The moose likes Java in General and the fly likes To Cay and Gary: Pack Transfer Format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "To Cay and Gary: Pack Transfer Format " Watch "To Cay and Gary: Pack Transfer Format " New topic
Author

To Cay and Gary: Pack Transfer Format

Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
Hi Cay and Gary,

I wonder why we need to have our own Pack Transfer Format instead of making use of the existing compression techniques, like ZIP/JAR, etc.

In JSR 200, it mentioned that this is because the JVM is too large that people is difficult to download it, and they using the pack format to reduce the size. However, does this format only useful for bytecode, while other compression algorithms do not really help?

Nick


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Cay Horstmann
author
Ranch Hand

Joined: Nov 14, 2004
Posts: 114
    
  10
zip/gzip are general-purpose compression formats that perform well on a wide variety of data. Occasionally, someone comes up with a better compression algorithm that wrings out a few extra percent, but most people don't bother switching.

Pack200 is different. It is optimized for Java class files. For class files, it can achieve dramatically better compression than zip/gzip. According to http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/pack200.html#pack200_compression,
"One can expect compression to 1/9 the size of the JAR file, if it contains only class files and is in the order of several MB." I tried this out with a couple of examples, and indeed, the results were excellent.

However, if you use Pack200 for other formats, such as image files, the result would not be impressive.

What's not to like about Pack200? Since older JVMs don't know about it, you either have to make sure that all users of your applet/web start app have 5.0, or you have to rig the server to serve up either a traditional JAR or a Pack200-compressed one. See the above link for details.

Cheers,

Cay


Author of Java 8 for the Really Impatient
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982

However, if you use Pack200 for other formats, such as image files, the result would not be impressive.

Even image files could not be benefit much, for Web applications with large image files, pack still help a lot, isnt it? Or we should use the traditional WAR file?

Nick
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982

you have to rig the server to serve up either a traditional JAR or a Pack200-compressed one

However, so far as I know, the latest release of WAS (should be 6.0) would be based on J2EE 1.4, and hence, we might still need to wait for a long time for J2EE Tiger released together with WAS 7.0, say , in order to *enjoy* this new compression feature.

Nick
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: To Cay and Gary: Pack Transfer Format