I am looking for classes in java.io that can read a line(and store that line in a string) from a binary file(example a avi video, png image or exectuable file), and then write this line to a file, without loosing the binary format.
So if I did like this:
If the input file was, example somemovie.avi, the output file would be an exact copy, and playable in media players like the orginal was.Code://Objects
String s = in.readLine ();
while (s != null)
{
out.write (s);
out.newLine ();
s = in.readLine ();
}
in.close ();
out.close ();
I tried myself some stuff:
these did not work. The binary format was lost, and my test image was corrupted.Code:File fil = new File ("C:\\img.png");
FileInputStream fis = new FileInputStream (fil);
InputStreamReader fin = new InputStreamReader (fis);
BufferedReader in = new BufferedReader (fin);
File fol = new File ("C:\\imgout.png");
FileOutputStream fo = new FileOutputStream (fol);
DataOutputStream out = new DataOutputStream (fo);
What classes should I use?

