Results 1 to 8 of 8

Thread: [RESOLVED] Reading/Writing data from/to ZIP

  1. #1

    Thread Starter
    Member RaZeR's Avatar
    Join Date
    Jan 2009
    Location
    Russia, Moscow
    Posts
    38

    Resolved [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

  2. #2
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    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.
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

  3. #3

    Thread Starter
    Member RaZeR's Avatar
    Join Date
    Jan 2009
    Location
    Russia, Moscow
    Posts
    38

    Re: Reading/Writing data from/to ZIP

    Quote Originally Posted by Jenner View Post
    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

  4. #4
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    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.
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

  5. #5

    Thread Starter
    Member RaZeR's Avatar
    Join Date
    Jan 2009
    Location
    Russia, Moscow
    Posts
    38

    Re: Reading/Writing data from/to ZIP

    Quote Originally Posted by Jenner View Post
    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

  6. #6
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    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?
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

  7. #7

    Thread Starter
    Member RaZeR's Avatar
    Join Date
    Jan 2009
    Location
    Russia, Moscow
    Posts
    38

    Arrow Re: [RESOLVED] Reading/Writing data from/to ZIP

    Quote Originally Posted by Jenner View Post
    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

  8. #8
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    Re: [RESOLVED] Reading/Writing data from/to ZIP

    Nice find! *adding rep as well*
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

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
  •  



Click Here to Expand Forum to Full Width