File IO: Reading and Writing Stream Data

File IO in Java can be very confusing at first. The reason is because there are a number of abstract classes, and a large number of IO classes that implement specific aspects of IO behavior or requirements, which results in the programmer wrapping two or often three different File class constructors in order to get the desired implementation.

The classes we refer to here are in the java.io package.

Input and Output Streams

Java's implementation of input and output (I/O) services is based on streams. Streams are used to read and write byte data. The data may come from a file, a network socket, a remote object, a serialized object, input at the command line, or somewhere else. Streams can be filtered, allowing ...

Get Java Garage now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.