Re: File Conversions Help
1. Welcome to Java Programming Forums.
2. What have you tried so far?
3. How are you actually converting the file to binary?
Re: File Conversions Help
Every file contains bytes and can be considered binary. What do you mean by: "convert a file(txt,jpeg,mp3,wav) into binary file"? All files are already binary and can be read byte by byte.
Can you explain what you mean by a "binary file"?
Re: File Conversions Help
Quote:
Originally Posted by
Norm
Every file contains bytes and can be considered binary. What do you mean by: "convert a file(txt,jpeg,mp3,wav) into binary file"? All files are already binary and can be read byte by byte.
Can you explain what you mean by a "binary file"?
Converting into binary means I'm writing The same file in to 0's and 1's
Re: File Conversions Help
All files consist of bits with the values of 0 or 1?
Do you mean you want a text file with the String values: "0" and "1"?
With 8 characters for every byte in the original file?
Can you explain why you want to make the file 8 times larger?
Re: File Conversions Help
my compression program accepts only the string values, what exactly i want to do is to convert a input file in to 0's and 1's and then i want to process that file containing 0's and 1's through one of my compression program which will give me another output file which is very small than the original file size. The problem I face is when i decode ie when i use the output file to get the 0's and 1's I'm not able to convert it back to the original file from that o's and 1's that are obtained.
Re: File Conversions Help
Quote:
convert a input file in to 0's and 1's
That will make the file 8 times larger since one byte will become 8 characters.
Quote:
problem I face is when i decode ie when i use the output file to get the 0's and 1's I'm not able to convert it back to the original file
I suggest for working out the technique that you work with a short array of byte values. Convert them to "0"s and "1"s, and then convert the "0"s and "1"s back to the the byte array. Leave out the compression part for future testing.
Re: File Conversions Help
Quote:
Originally Posted by
kyanamgoutham
my compression program accepts only the string values, what exactly i want to do is to convert a input file in to 0's and 1's and then i want to process that file containing 0's and 1's through one of my compression program which will give me another output file which is very small than the original file size. The problem I face is when i decode ie when i use the output file to get the 0's and 1's I'm not able to convert it back to the original file from that o's and 1's that are obtained.
Why not? How are you trying to convert them back? Is there any special character after each byte?