Filter Stream Classes

BufferedInputStream and BufferedOutputStream
These classes buffer reads and writes by reading data first into a buffer (an internal array of bytes). Thus an application can read bytes from the stream without necessarily calling the underlying native method. The data is read from or written into the buffer in blocks; subsequent accesses go straight to the buffer.
DataInputStream and DataOutputStream
These classes read and write primitive Java data types and strings in a machine-independent way. (Big-endian for integer types, IEEE-754 for floats and doubles, modified UTF-8 for Unicode)
PrintStream
PrintStream allows very simple printing of both primitive values, objects, and string literals. It uses the platform's default character encoding to convert characters into bytes. This class traps all IOExceptions. This class is primarily intended for debugging. System.out and System.err are instances of PrintStream.
PushbackInputStream
This input stream has a one byte pushback buffer so a program can unread the last character read. The next time data is read from the stream, the "unread" character is re-read.
GZIPInputStream and GZIPOutputStream

From the java.util.zip package, these classes provide compression and decompression services

DigestInputStream and DigestOutputStream

From the java.util.security package, these classes can calculate a message digest for a stream using a strong hash function like SHA.

CipherInputStream and CipherOutputStream

From the javax.crypto package in the Java Cryptography Extension (JCE), a standard extension to Java, these classes can calculate encrypt or decrypt streams using a variety of algorithms like DES, RSA, Blowfish, and more.

ObjectInputStream and ObjectOutputStream

Subclasses of DataInputStream and DataOutputStream that can also serialize and deserialize Java objects to and from raw bytes. Used by remote method invocation (RMI) and JavaBeans.

You can also create your own subclasses of FilterInputStream and FilterOutputStream that perform custom filtering.


Previous | Next | Top | Cafe au Lait

Copyright 1997, 1999 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified November 19, 1999