1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| public static void main(String[] args) throws Exception{
FileReader fr=new FileReader("test.txt"); FileWriter fw=new FileWriter("test2.txt");
int b; while((b=fr.read())!=-1){
System.out.print("-"+(char)b); fw.write(b); } fr.close(); fw.close(); }
|