Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (541)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Reading a 7z archive?  (Read 3680 times)
0 Members and 1 Guest are viewing this topic.
Offline Renoria

Junior Devvie




...


« Posted 2008-12-27 10:50:52 »

Is there a way to read a 7z archive with a 3rd party lib or something?

I read about it http://www.7-zip.org/sdk.html << There but it doesn't tell me enough information.

Thanks.
Offline hishadow

Senior Newbie





« Reply #1 - Posted 2008-12-27 14:48:54 »

That (for the java code included) only gives you the ability to pack/unpack a single file with lzma. Handling the 7z archive format need additional code. The format is described though in 7zFormat.txt if you want to do it yourself. Smiley

ed: an easier way is to: your files -> uncompressed jar/zip -> lzma pack -> include in your program -> unpack lzma -> handle further as ordinary jar/zip
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #2 - Posted 2008-12-27 21:09:46 »

7z isn't suited to be directly used by games, since accessing individual files is rather slow. However, LZMA is great for installers or downloaded resources.

弾幕 ☆ @mahonnaiseblog
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Renoria

Junior Devvie




...


« Reply #3 - Posted 2008-12-28 02:43:55 »

7z isn't suited to be directly used by games, since accessing individual files is rather slow. However, LZMA is great for installers or downloaded resources.

MapleStory uses 7z.
Offline i30817

Junior Devvie





« Reply #4 - Posted 2008-12-28 03:20:01 »

I'd be interrested in using a simple 7z api - something like the jdk zipfile with the List getHeaders() and name, date, CRC32, etc functions. But it's only for completness sake, for me, since there is now a java rar api (junrar)
Offline Renoria

Junior Devvie




...


« Reply #5 - Posted 2008-12-28 03:49:49 »

I'd be interrested in using a simple 7z api - something like the jdk zipfile with the List getHeaders() and name, date, CRC32, etc functions. But it's only for completness sake, for me, since there is now a java rar api (junrar)

I would probably like the 7z archiver because its not that popular, therefore it is harder to hack?
Offline Renoria

Junior Devvie




...


« Reply #6 - Posted 2008-12-29 06:55:15 »

OMG, I just tried LZMA for java and encrypting a 1kb file gives a OutOfMemoryError.
Offline hishadow

Senior Newbie





« Reply #7 - Posted 2008-12-29 08:11:23 »

OMG, I just tried LZMA for java and encrypting a 1kb file gives a OutOfMemoryError.
Now, I'm not sure about encrypting with LZMA is a good thing Cheesy, but LZMA compression/decompression uses alot of memory. That's the price you pay for better compression ratio. You can to some degree control the memory usage by experimenting with the compression parameters (which control the size of the dictionary used by LZMA during decompression).
Offline Renoria

Junior Devvie




...


« Reply #8 - Posted 2008-12-29 10:49:52 »

If I use ZIP, is there a way I can maybe add some extra bytes to annoy hackers which try to extract it?
Offline SimonH
« Reply #9 - Posted 2008-12-29 11:30:13 »

Why not use zip/jar but encrypt the data with the javax.crypto package?

People make games and games make people
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Renoria

Junior Devvie




...


« Reply #10 - Posted 2008-12-29 11:34:52 »

Why not use zip/jar but encrypt the data with the javax.crypto package?

can you get me some Java Docs/Tutorials for this? xD

Also, don't all users who use this need the Unlimited Strength Cryptography extension in their JDK? Just wondering....
Offline SimonH
« Reply #11 - Posted 2008-12-29 12:38:15 »

can you get me some Java Docs/Tutorials for this? xD

Also, don't all users who use this need the Unlimited Strength Cryptography extension in their JDK? Just wondering....

Java doc here. javax.crypto is a standard part of J2SE - I've never tried it but it should work anywhere...

People make games and games make people
Offline Renoria

Junior Devvie




...


« Reply #12 - Posted 2008-12-29 12:42:48 »

Okay I can encrypt it, but java.util.zip constructors are either File or String so how do I read it? With fileinputstream I mean
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 847
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #13 - Posted 2008-12-29 14:48:25 »

new ZipInputStream(InputStream); persecutioncomplex

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline Renoria

Junior Devvie




...


« Reply #14 - Posted 2008-12-29 14:52:54 »

Oh, thanks Riven Wink

EDIT:

Is there a way to modify files under C:/Program Files/Java/jre-whatever/?

I need this to replace their files with the JCE extension.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Mr.CodeIt (24 views)
2014-12-23 03:34:11

rwatson462 (55 views)
2014-12-15 09:26:44

Mr.CodeIt (45 views)
2014-12-14 19:50:38

BurntPizza (86 views)
2014-12-09 22:41:13

BurntPizza (110 views)
2014-12-08 04:46:31

JscottyBieshaar (81 views)
2014-12-05 12:39:02

SHC (91 views)
2014-12-03 16:27:13

CopyableCougar4 (98 views)
2014-11-29 21:32:03

toopeicgaming1999 (157 views)
2014-11-26 15:22:04

toopeicgaming1999 (154 views)
2014-11-26 15:20:36
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!