storing the length also lends itself well to compressing files with only one character in them...
for example, when i compressed the 16384 byte file called "zeros.txt" that was in the jar file, my compressed file size was 8 bytes (the size of my header... "CH" + the file size + the 9 bits required to store the tree information). and it decompressed back into an identical file.
amusingly, adding a single different character to the end of the file inflates the compressed file size to about 2KB, but still, it's kind of cool.
jason |