org.apache.fulcrum.jce.crypto
Class SmartDecryptingInputStream
java.lang.Object
java.io.InputStream
java.io.ByteArrayInputStream
org.apache.fulcrum.jce.crypto.SmartDecryptingInputStream
- All Implemented Interfaces:
- Closeable
public class SmartDecryptingInputStream
- extends ByteArrayInputStream
An input stream that determine if the originating input stream
was encrypted or not. This magic only works for well-known file
types though.
- Author:
- Siegfried Goeschl
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SmartDecryptingInputStream
public SmartDecryptingInputStream(CryptoStreamFactory cryptoStreamFactory,
InputStream is)
throws IOException,
GeneralSecurityException
- Constructor
- Parameters:
cryptoStreamFactory
- the CryptoStreamFactory for creating a cipher streamis
- the input stream to be decrypted
- Throws:
IOException
GeneralSecurityException
SmartDecryptingInputStream
public SmartDecryptingInputStream(CryptoStreamFactory cryptoStreamFactory,
InputStream is,
char[] password)
throws IOException,
GeneralSecurityException
- Constructor
- Parameters:
cryptoStreamFactory
- the CryptoStreamFactory for creating a cipher streamis
- the input stream to be decryptedpassword
- the password for decryption
- Throws:
IOException
GeneralSecurityException
copy
public long copy(InputStream is,
OutputStream os)
throws IOException
- Pumps the input stream to the output stream.
- Parameters:
is
- the source input streamos
- the target output stream
- Returns:
- the number of bytes copied
- Throws:
IOException
- the copying failed
Copyright © 2008-2009 The Apache Software Foundation. All Rights Reserved.