Readers | Writers  

java.io Mini API

As all programmers learn early on, most programs cannot accomplish their goals without accessing external data. Data is retrieved from an input source. The results of a program are sent to an output destination. In Java, these sources or destinations are defined very broadly. For example, a network connection, memory buffer, or disk file can be manipulated by the Java I/O classes. Although physically different, these devices are all handled by the same abstraction: the stream.

java.io Class Extends From Key Constructor(s) Arguments Key Methods
File Object File, String
String
String, String
createNewFile()
delete()
exists()
isDirectory()
isFile()
list()
mkdir()
renameTo()
FileWriter Writer File
String
close()
flush()
write()
BufferedWriter Writer Writer close()
flush()
newLine()
write()
PrintWriter Writer File (as of Java 5)
String (as of Java 5)
OutputStream
Writer
close()
flush()
format()*, printf()*
print(), println()
write()
FileReader Reader File
String
read()
BufferedReader Reader Reader read()
readLine()

The I/O classes defined by java.io are listed here:
I/O classes defined by java.io