Line-by-Line Copying
BufferedReader reader = new BufferedReader(...);
// Read the first line.
String line = reader.readLine();
// null returned on EOF.
while(line != null){
// Write the whole line.
writer.write(line);
// Add the newline character.
writer.newLine();
// Read the next line.
line = reader.readLine();
}
Previous slide
Next slide
Back to first slide
View graphic version