I was wondering if you guys can clear up a few questions for me concering how data is stored.
1. If I have a txt file that is 78,390 bytes long. If I wish to view and manipulate the raw binary data, I have to convert byte data into binary data and then write the binary data to a txt file. This binary data txt file is 8 times larger than the orignal txt file.
Im not sure I udnerstand this. Do you mena to say youa re taking each bit sequentially in the file and writing it out as a 0 or 1 valued byte?
If so why?
2. The previous is a compression related question, so I was also wondering if anyone can explain the principle upon which winZip or winRar work? How do these programs compress the data to a smaller size? What level of access do they have to the file they are compressing?
Edit: I have found an article on the Huffman Compression algorithm and have answered the second question myself. I am still interested in how I can access the data on that level with Java though. I have found a java applet that shows the process, but it doesnt actually write the compressed file.
Well, huffman is just oen of many compression schemes and a failry simple on.
But if yopu want to work with Zip style comrepssed fiels in Java the ehavy lifting is all done for you by Zip* classes
(ZipFile, ZipInputStream and ZipOutputStream). A ncie Java feature.
Any answers to these questions are greatly appreciated.[/quote]