EncryptedInputStream public class EncryptedInputStream extends FilterInputStream An InputStream that supports encryption. This class encapsulates a StreamCipher or BlockCipher as an InputStream. You set up your cipher, pass it and the underlying stream to the EncryptedInputStream constructor, and then read your cleartext from this stream. It gets read from the underlying stream and decrypted.
Encryption is done by an EncryptedOutputStream.
When used with a StreamCipher, no input protocol is necessary, each byte of ciphertext turns into one byte of cleartext. When used with a BlockCipher it's more complicated. Each block of ciphertext is read from the stream, decrypted into a block of cleartext, and then one more byte is read that says how many bytes in the block are valid. Generally the bytecount will be equal to the block size, but it can be less if the stream gets flushed or closed on a partial block. Fetch the software.