O'Reilly logo

Special Edition Using Java 2 Standard Edition by Geoff Friesen, Chuck Cavaness, Brian Keeton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reading and Writing Data Using Byte Streams

There are many different types of streams within the Java API. Each type of stream within the Java API is represented by a different Java class or interface. The InputStream and OutputStream classes represent the simplest of the byte stream classes. These two classes provide general streaming capabilities for byte data. Java uses these base classes to derive other classes that are more specifically oriented toward a certain type of input or output. You can find all the various stream classes in the java.io package. Here are a few of the available streams for byte data:

  • BufferedInputStream — A basic buffered input stream

  • DataInputStream — An input stream for reading primitive data types

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required