JAVA Code is as follows:
Package hand. wang. test; </P> <p> Import Java. io. fileinputstream; <br/> Import Java. io. fileoutputstream; <br/> Import Java. io. ioexception; <br/> Import Java. io. inputstream; <br/> Import Java. io. outputstream; <br/> Import java.net. malformedurlexception; </P> <p> public class readwritefile {<br/>/** <br/> * read data from the primary file 11.txtand write it into the primary file 12.txt <br/> * @ author zhoujianwang <br/> * <br/> */<br/> Public static Vo Id main (string [] ARGs) throws ioexception {<br/> // input stream <br/> inputstream in = new fileinputstream ("D:/11.txt "); <br/> // output stream <br/> outputstream out = new fileoutputstream ("D:/12.txt", true ); </P> <p> try {<br/> byte [] buffer = new byte [1024]; <br/> while (true) {<br/> int byteread = in. read (buffer); <br/> If (byteread =-1) <br/> break; <br/> out. write (buffer, 0, byteread); <br/>}</P> <p> Catch (malformedurlexception ex) {<br/> system. err. println (ARGs [0] + "is not a URL Java understands. "); <br/>}finally {<br/> If (in! = NULL) <br/> in. Close (); <br/> If (OUT! = NULL) {<br/> out. Close (); <br/>}< br/>}