
[]
7.5 DataInputStream and DataOutputStream
95
8
9
10
11
12
13
14
15
16
17
}
FileReader in = new FileReader("Filel.txt");
BufferedReader inBuffer = new BufferedReader(in);
while ((c = inBuffer.read()) l= -I){
System.out.print((char) c );
}
inBuffer, close () ;
in.close();
ReadBufFile
In line 9, we create a FileReader stream as previously. In line 1 O, we then create BufferedReader
stream to wrap the FileReader stream, in.
The remaining code is as before except that in line 11 we read from the buffer stream
using the java. io. BufferedReader. read method.
7.5 DatalnputStream and DataOutputStream
DataInputStream and ...