Tutorial: introduction to I/O in Java
Java provides quite flexible libraries for dealing with input/output
operations such as reading and writing to files or network sockets.
A number of key classes and packages are provided as part of the JDK
for dealing with I/O in Java:
- The java.io package
- This is the standard Java I/O package. It focusses primarily on
stream-based I/O. It also provides methods for querying the file system.
- The java.net package
- Provides some extra support classes specifically for Java networking, with
various of the stream classes from the java.io package integrating with the java.net
- The java.nio package
- NIO is the "new I/O" package introduced in Java 1.4; it adds facilities
for efficient buffer-based I/O and selector-based I/O which is
particularly useful for handling multiple simultaneous connections on a server.
Although not strictly related to the Java I/O packages, you may also be interested
in the Arcmexer library, which allows reading from various
archive files. At present, it supports ZIPs (encrypted and unencrypted) and TAR files (compressed