Forums Register Login

rar algorithm in java?

+Pie Number of slices to send: Send
I have a few questions:
1. Is rar based on zip? Could a rar file be opened with java.util.zip.*?
2. Is there an open-source implementation of rar?
3. What would I have to do to make a jar file with rar compression?
For #3, I'm guessing I would need to:
1. Compress the file with rar algorithm
2. Add some special bytes? to signify it's a jar - what are these?
3. add a manifest
4. write my own classloader (extend URLClassloader) that can understand rars.

Am I missing anything? Does anyone know of any work in this area? I think something like this would be great for J2ME, etc because rar almost always compresses quite a bit more than zip.
+Pie Number of slices to send: Send
 

Originally posted by Robert Paris:
I have a few questions:
1. Is rar based on zip? Could a rar file be opened with java.util.zip.*?

Pretty sure it's "No" - why not try it for yourself?

2. Is there an open-source implementation of rar?

Doubt it

3. What would I have to do to make a jar file with rar compression?
For #3, I'm guessing I would need to:
1. Compress the file with rar algorithm
2. Add some special bytes? to signify it's a jar - what are these?
3. add a manifest
4. write my own classloader (extend URLClassloader) that can understand rars.

What's the point of doing this anyway?

Am I missing anything? Does anyone know of any work in this area? I think something like this would be great for J2ME, etc because rar almost always compresses quite a bit more than zip.


Ah, that's your point. But so? I mean, one could probably come up with an equally compressed algorithm, but it wouldn't be compatible with JAR either, so what?
+Pie Number of slices to send: Send
rar is a proprietary technology. Unless the owners of the format release a Java implementation (which is unlikely, I think) there won't be one (unless someone created one based on reverse engineering the algorithm which would be completely unauthorised and possibly a violation of patents).
+Pie Number of slices to send: Send
I did not know that. Is there a non-proprietary format that compresses as well as rar? I'd be totally willing to implement it in java and share it on this site.
+Pie Number of slices to send: Send
I'm still not even sure this effort is useful, but you could try to implement 7zip: http://www.7-zip.org
Brian
+Pie Number of slices to send: Send
I guess you're looking for this....http://www.wotsit.org/ where you can search for the "rar" format specification......but as Brian pointed out, i'm sure it's not worth the effort!
+Pie Number of slices to send: Send
Looks like Tiger was ahead of me on this:
http://java.sun.com/j2se/1.5.0/docs/api/javax/pack/package-summary.html
It's not the RAR algorithm, but it's 8-times more compact than jar/zip.
Hey! Wanna see my flashlight? It looks like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2495 times.
Similar Threads
new to java (error: package com.jgoodies.forms.* does not exist)
Resource adapter - deploy without restarting the server?
necessity of JAD in OTA ???
add zip or jars to classpath
extract .rar file with java
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 06:24:10.