Character Stream is based on characters when reading and writing files
Core classes of character streams in I/O
The reader and writer classes are the parent classes of all character stream classes, as well as abstract classes. FileReader and FileWriter are their subclasses, respectively.
Core methods of the core class:
Reader:
int read (char [] c, int off, int len);
Writer:
void write (char [] c, int off, int len);
Import java.io.*;p ublic class test{public static void Main (String args[]) {FileReader FR = null; FileWriter FW = NULL;TRY{FR = new FileReader ("F:/android/java4android/33/src/a.txt"), FW = new FileWriter ("F:/android/ Java4android/33/src/b.txt "); char [] c = new Char [100];int cLen = Fr.read (c,0,c.length); Fw.write (C,0,clen);} catch (Exception e) {System.out.println (e);} Finally{try{fr.close (); Fw.close ();} catch (Exception e) {System.out.println (e);}}}}
for (int i = 0;i <c.length;i++) {System.out.println (c[i]);}
The character stream of I/O in Java