Results 1 to 8 of 8
  1. #1
    ElvisMachuca is offline Member
    Join Date
    Jan 2013
    Posts
    32
    Rep Power
    0

    Default How To Write A Zip File Like Application

    Hi,

    I want to write an application which stores files inside of itself, like a Zip file, but it will not be a zip or have the zip compression class.

    Can anyone help find a way to do that?

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: How To Write A Zip File Like Application

    stores files inside of itself
    Can you explain what that means? What kind of objects or disk files are you talking about? What changes would the program make to what kind of files?
    Why the reference to zip files?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    ElvisMachuca is offline Member
    Join Date
    Jan 2013
    Posts
    32
    Rep Power
    0

    Default Re: How To Write A Zip File Like Application

    Quote Originally Posted by Norm View Post
    Can you explain what that means? What kind of objects or disk files are you talking about? What changes would the program make to what kind of files?
    Why the reference to zip files?
    The reference to Zip file has to do with the fact that Zip file application is the one thing that can store a file within another file.

    For example, I have File.A, File.B, File.C, and when I make a Zip file, I have File.Zip which has the previous 3 files stored inside of it.

    The thing is that I wrote a compression/decompression library, and I want to write my own zip like application.

    I just think that my compression/decompression algorithm is more efficient then the GZip library compression algorithms.

    Unless you don't know what a zip is, I cannot explain anymore...I you sure must've come across compressed zip files...That's what I am referring to.

    One example, is when you send an attachment through Hotmail or Outlook (today), it places all your attachment into a zip compressed file, and send its as the attachment in your email to another person.

    When the other person receives the email, he sees the attachment, downloads it, and extracts all files from within that compressed zip file.
    Last edited by ElvisMachuca; 02-02-2014 at 02:51 PM.

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: How To Write A Zip File Like Application

    Yes, I know what a zip file is. What was confusing was this: "stores files inside of itself"
    What does "inside itself" mean? If the program was executing from class file, where would the "itself" be?

    Otherwise I imagine you are talking about a program that copies files into another zip like file with a structure that allows those files to be extracted back to their original content.
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,411
    Rep Power
    5

    Default Re: How To Write A Zip File Like Application

    I find it interesting that you developed a more efficient compression algorithm than Dr. Huffman of MIT and yet can't figure out how to store consecutive files in a single file. I'm not saying it's not possible, just interesting. In any event, store the name of the file, it's compressed size, then the compressed file followed by a CRC of the uncompressed file (for final integrity check). Then repeat the process until all files are stored. I may have left a few requirements out, but I'm sure you get the idea.

    Regards,
    Jim
    The Java Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  6. #6
    zFollette is offline ▼ dafuq did I do?
    Join Date
    Dec 2013
    Posts
    203
    Rep Power
    0

    Default Re: How To Write A Zip File Like Application

    Well, what compressing does, is it finds a pattern in the file contents, then saves the pattern once. You can do this for all of the files, then save each pattern and the number of times repeated, into a file, along with the name of the file that the pattern belongs to.
    1000011 1100001 1101110 100000 1111001 1101111 1110101 100000 1110010 1100101 1100001 1100100 100000 1000010 1101001 1101110 1100001 1110010 1111001 111111

  7. #7
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,411
    Rep Power
    5

    Default Re: How To Write A Zip File Like Application

    Modern compression algorithms are much more than just finding repeated patterns. They can be as complicated as encryption or digest algorithms.

    Regards,
    Jim
    The Java Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  8. #8
    zFollette is offline ▼ dafuq did I do?
    Join Date
    Dec 2013
    Posts
    203
    Rep Power
    0

    Default Re: How To Write A Zip File Like Application

    Quote Originally Posted by jim829 View Post
    Modern compression algorithms are much more than just finding repeated patterns. They can be as complicated as encryption or digest algorithms.

    Regards,
    Jim
    I guess... Though the same principle applies, you can save the outcome of the algorithm to a file, then the de-compressor would read that file, and puke out the original file.
    1000011 1100001 1101110 100000 1111001 1101111 1110101 100000 1110010 1100101 1100001 1100100 100000 1000010 1101001 1101110 1100001 1110010 1111001 111111

Similar Threads

  1. Help for write Bank application in Java
    By clapton in forum New To Java
    Replies: 4
    Last Post: 02-26-2012, 08:27 PM
  2. Trying to write a settings file for my application
    By stevenfriz in forum New To Java
    Replies: 1
    Last Post: 02-13-2012, 06:23 AM
  3. Replies: 2
    Last Post: 03-10-2011, 09:25 AM
  4. Replies: 3
    Last Post: 12-12-2008, 12:12 PM
  5. How to write the login application using cookies
    By lukky in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 08-19-2008, 06:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •