|
-
Jul 19th, 2009, 08:59 AM
#1
Thread Starter
Member
[RESOLVED] Reading/Writing data from/to ZIP
I have a game that have many data (textures, sound, etc.). I want to pack them in ZIP like textures.zip, sound.zip, etc, then read/write files from my code. I didn't found any examples for reading files from ZIP without unzipping. Please help me! 
P.S: Maybe it's better to use Resource file?
P.P.S: Sorry for my English.
VB 6, VB.NET, C#, Java, JavaME, C/C++ and Assembler Programmer

If my post was helpful, rate me 
-
Jul 21st, 2009, 09:31 AM
#2
Re: Reading/Writing data from/to ZIP
Unfortunately, all the zip implementations I know of need to write an output file. Let me explore a little for you to see if I can find any "unzip-to-memory" compression libraries.
Do you care that it's "ZIP"? I think there are some out there that are specifically made for gaming but they don't use the PKZIP compression scheme and file structure.
-
Jul 21st, 2009, 01:53 PM
#3
Thread Starter
Member
Re: Reading/Writing data from/to ZIP
 Originally Posted by Jenner
Do you care that it's "ZIP"? I think there are some out there that are specifically made for gaming but they don't use the PKZIP compression scheme and file structure.
Thanks for reply 
I don't care about ZIP format. Maybe it is better to use packages such as .pak and .pk. Where i can find free libraries for packaging/unpackaging/reading/etc. paks?
VB 6, VB.NET, C#, Java, JavaME, C/C++ and Assembler Programmer

If my post was helpful, rate me 
-
Jul 22nd, 2009, 09:49 AM
#4
Re: Reading/Writing data from/to ZIP
Ok, I did some checking and found the SharpZip library can do what you want.
It's free (GPL license) and it works via Streams. Thus, all you do is specify the target ZIP archive, the file you want from it, and it makes a stream. What you do from that point is up to you. You could then direct it to a streamwriter pointing to a file if you wanted to write the extracted file to disc, or you could just keep it in memory and use it, etc...
Check it out.
-
Jul 22nd, 2009, 01:36 PM
#5
Thread Starter
Member
Re: Reading/Writing data from/to ZIP
 Originally Posted by Jenner
Check it out.
Thanks you! I'm also found a free PAK lib, in my game i will use PAK, ZIP i will use in other things. Thanks! 
*adding rep*
VB 6, VB.NET, C#, Java, JavaME, C/C++ and Assembler Programmer

If my post was helpful, rate me 
-
Jul 22nd, 2009, 02:03 PM
#6
Re: [RESOLVED] Reading/Writing data from/to ZIP
PAK was designed for games I think so it's probably a better choice anyways! Where did you find it? Can you post a link?
-
Jul 23rd, 2009, 03:59 AM
#7
Thread Starter
Member
Re: [RESOLVED] Reading/Writing data from/to ZIP
 Originally Posted by Jenner
PAK was designed for games I think so it's probably a better choice anyways! Where did you find it? Can you post a link?
I found it on freevbcode.com, here is a link.
VB 6, VB.NET, C#, Java, JavaME, C/C++ and Assembler Programmer

If my post was helpful, rate me 
-
Jul 23rd, 2009, 07:19 AM
#8
Re: [RESOLVED] Reading/Writing data from/to ZIP
Nice find! *adding rep as well*
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|