public final void decryptStream ( SecretKey sharedKey , InputStream input , OutputStream output ) throws IOException { logger . entry ( ) ; CipherInputStream cipherInput = null ; try { logger . debug ( "Creating a special input stream to do the work..." ) ; cipherInput = decryptionInputStream ( sharedKey , input ) ; logger . debug ( "Reading bytes, decrypting them, and writing them out..." ) ; IOUtils . copy ( cipherInput , output ) ; output . flush ( ) ; } finally { if ( cipherInput != null ) cipherInput . close ( ) ; } logger . exit ( ) ; }
This method decrypts a byte stream from an encrypted byte stream .