Java IO Tutorial

Connect with me: - News

Most applications need to process some input and produce some output based on that input. The purpose of the Java IO package ( is to make that possible in Java.

If you look at the Java IO classes in the package the vast amount of choices can be rather confusing. What is the purpose of all these classes? Which one should you choose for a given task? How do you create your own classes to plugin? etc. The purpose of this tutorial is to try to give you an overview of how all these classes are grouped, and the purpose behind them, so you don't have to wonder whether you chose the right class, or whether a class already exists for your purpose.

The Scope of the Java IO ( Package

The package doesn't actually address all types of input and output. For instance, input from and output to a GUI or web page is not covered in the Java IO package. Those types of input are covered elsewhere, for instance by the JFC classes in the Swing project, or the Servlet and HTTP packages in the Java Enterprise Edition.

The Java IO package is primarily focused on input and output to files, network streams, internal memory buffers etc.

More Java IO Tools, Tips etc.

The tutorial trail called Java How To's and Utilities also contain a few Java IO utilities - e.g. replacing strings in streams, iterating streams using buffers etc.

The Scope of this Java IO Tutorial

Below is a table of contents of the topics and classes covered in this tutorial. The coverage of the classes is not just an API listing. You can get that from Sun's official Java Doc's. Rather each text is a short introduction to the class, its purpose, and a few examples of how to use it. In other words, some of the stuff you don't find in Sun's official Java Doc's.

Java IO
Java IO Introduction
Java IO Overview
Java Files
Java Pipes
Java Networking
Java Byte + Char Arrays
Java / .out / .error
Java Streams
Java Readers / Writers
Java Input Parsing
Java Concurrent IO
Java IO Exception Handling
Java InputStream
Java OutputStream
Java FileInputStream
Java FileOutputStream
Java RandomAccessFile
Java File
Java PipedInputStream
Java PipedOutputStream
Java ByteArrayInputStream
Java ByteArrayOutputStream
Java FilterInputStream
Java FilterOutputStream
Java BufferedInputStream
Java BufferedOutputStream
Java PushbackInputStream
Java SequenceInputStream
Java DataInputStream
Java DataOutputStream
Java PrintStream
Java ObjectInputStream
Java ObjectOutputStream
Java Serializable
Java Reader
Java Writer
Java InputStreamReader
Java OutputStreamWriter
Java FileReader
Java FileWriter
Java PipedReader
Java PipedWriter
Java CharArrayReader
Java CharArrayWriter
Java BufferedReader
Java BufferedWriter
Java FilterReader
Java FilterWriter
Java PushbackReader
Java LineNumberReader
Java StreamTokenizer
Java PrintWriter
Java StringReader
Java StringWriter
Connect with me:
Newsletter - Get all my free tips!