The I/O classes defined by Java.io are shown in the following table:
| Bufferedinputstream |
Bufferedoutputstream |
BufferedReader |
BufferedWriter |
Bytearrayinputstream |
Bytearrayoutputstream |
Chararraywriter |
Console |
DataInputStream |
| DataOutputStream |
File |
FileDescriptor |
FileInputStream |
FileOutputStream |
Filepermission |
FileReader |
FileWriter |
FilterInputStream |
| Filteroutputstream |
FilterReader |
Filterwriter |
InputStream |
InputStreamReader |
LineNumberReader |
ObjectInputStream |
Writer |
OutputStream |
| ObjectOutputStream |
ObjectStreamClass |
Objectstreamfile |
Pipedreader |
PipedInputStream |
PipedOutputStream |
PipedWriter |
Reader |
PrintStream |
| PrintWriter |
Streamtokenizer |
StringReader |
StringWriter |
Randomaccessfile |
|
|
|
|
Stream-based I/O in Java is based on 4 abstract classes: Inputstream,outputstream,reader and Writer. InputStream and OutputStream are used for byte stream, Reader and writer for character streams. In general, you should use a character stream class when dealing with characters or strings, and you should use a byte stream class when dealing with characters and other binary objects.
Explore Java I/O classes and Interfaces