package example5_3javaiodecorator; import java.io.FilterInputStream; import java.io.IOException; import java.io.InputStream; import java.util.LinkedList; import java.util.Queue; /** * @author hornick * This input stream decorator modifies a wrapped input stream */ public class EncryptedInputStream extends FilterInputStream { private String encryptionKey; // the "key" to use for encryption private Queue shifter; // Encryption "barrel". Note: Queue is abstract /** * constructs the input stream encrypter * @param key (ignored currently) * @param wrappedStream */ public EncryptedInputStream(String key, InputStream wrappedStream) { super(wrappedStream); // TODO: This shifter is unused. Use it. // fill the barrel with the encryption key shifter = new LinkedList(); encryptionKey = key; for( int c = 0; c