CIS 35A: Introduction to Java Programming

Home | Green Sheet | Lectures | Assignments | FAQ | Grades

Files

Text and Binary Files
Introduction
FilterInputStream/FilterOutputStream

FilterInputStream/FilterOutputStream

Filter streams are streams that filter bytes for some purpose. The basic byte input stream provides a read method that can only be used for reading bytes. If you want to read integers, doubles, or strings, you need a filter class to wrap the byte input stream. Using a filter class enables you to read integers, doubles, and strings instead of bytes and characters. FilterInputStream and FilterOutputStream are the base classes for filtering data. When you need to process primitive numeric types, use DatInputStream and DataOutputStream to filter bytes.

Previous | How is I/O Handled in Java? | Text File vs. Binary File | Object I/O | FileInputStream/FileOutputStream | FilterInputStream/FilterOutputStream | ObjectInputStream/ObjectOutputStream | BufferedInputStream/ BufferedOutputStream | DataInputStream/DataOutputStream | Next