This chapter discusses filter streams for cryptography. The Java core API contains two of these in the java.security package, DigestInputStream and DigestOutputStream. The javax.crypto package contains two more, CipherInputStream and CipherOutputStream. All four of these streams use an engine object to handle the filtering. DigestInputStream and DigestOutputStream use a MessageDigest object while CipherInputStream and CipherOutputStream use a Cipher object. The streams rely on the programmer to properly initialize andin the case of the digest streamsclean up after the engines. Therefore, we'll first look at the engine classes and then at the streams built around these engines.
Basic I/O
Introducing I/O
Output Streams
Input Streams
Data Sources
File Streams
Network Streams
Filter Streams
Filter Streams
Print Streams
Data Streams
Streams in Memory
Compressing Streams
JAR Archives
Cryptographic Streams
Object Serialization
New I/O
Buffers
Channels
Nonblocking I/O
The File System
Working with Files
File Dialogs and Choosers
Text
Character Sets and Unicode
Readers and Writers
Formatted I/O with java.text
Devices
The Java Communications API
USB
The J2ME Generic Connection Framework
Bluetooth
Character Sets