while ((c = in.read() )!= -1) out.write(c); in.close(); out.close(); System.out.println("Renaming the XML FILE"); } I am copying files using this method. Input file is 10kb(356 lines) and output file is 8kb(309 lines). It's not copying the files completely. It is not copying last 50 lines. Does anyone have any idea regarding this. I will appreciate
Bhasker Reddy
hennie louw
Ranch Hand
Joined: Jul 03, 2001
Posts: 56
posted
0
Im not sure if this will work but try to use a filereader / writer wrapped around a bufferdreader / bufferdwriter eg public void readFiles() { String data; try { BufferReader read = new BufferdReader(new FileReader(inputFile)); BufferdWriter write = new BufferdWriter(new FileWriter(outpurFile));
Any Body can be paid to write good code, but brilliant code can only come from passion
J Ochoa
Greenhorn
Joined: Jan 24, 2002
Posts: 1
posted
0
Originally posted by Bhasker Reddy:
out.close();
You might want to use the flush() method before this line. out.flush(); out.close(); I had that issue until I used the flush() method. Writes out everything now. -- Jayne
subject: copying files using fileReader, fileWriter