Skip to main content
gamedev.net
🔒 Locked

[java] Files within files within files.

Started by Goragoth 1 reply 700+ views
Original Post
Goragoth
Goragoth
I need some pointers as to how to go about creating a filesystem within a file. What I want to do is to put files (and preferably directories) into a single file, packing them together (preferbly with LZW compression too). So basically I want to be able to make a .zip file. Surely there must be an easy way of doing this in code in Java without having to write my own code to all this? For interest, the reason I want to do this is that I want to make an editor for a game (this is all in my head atm) that can create levels, sprites, weapons, items, particle systems and other cool things and then create single files (.mod or something) that can describe the game and that can be read by the game engine. I''m probably going way over my abilities here and I''ll start with something simple but this something useful that I would like to know anyway. I know there is a way to do this in C++ using MFC so surely there must be some class in Java can do it, I just haven''t found it yet =)
______"Crack a government encryption code on my laptop? Easy as really difficult pie." - Willow.------------------------------
c_wraith
c_wraith
Check out the java.util.zip package.
Goragoth
Goragoth
Thanks, that should do it. Just checked out the Javadocs for java.util.zip and it seems like it can do what I need. I knew it had to be somewhere but I was looking in java.io and couldn''t find anything.
______"Crack a government encryption code on my laptop? Easy as really difficult pie." - Willow.------------------------------

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.