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:
- java.io.Closeable
public class SmartDecryptingInputStream
- extends java.io.ByteArrayInputStream
An input stream that determine if the originating input stream
was encrypted or not. This magic only works for text files though.
- Author:
- Siegfried Goeschl
Fields inherited from class java.io.ByteArrayInputStream |
buf, count, mark, pos |
Method Summary |
void |
copy(java.io.InputStream is,
java.io.OutputStream os)
Pumps the input stream to the output stream. |
Methods inherited from class java.io.ByteArrayInputStream |
available, close, mark, markSupported, read, read, reset, skip |
Methods inherited from class java.io.InputStream |
read |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SmartDecryptingInputStream
public SmartDecryptingInputStream(CryptoStreamFactory cryptoStreamFactory,
java.io.InputStream is)
throws java.io.IOException,
java.security.GeneralSecurityException
- Constructor
- Parameters:
cryptoStreamFactory
- the CryptoStreamFactory for creating a cipher streamis
- the input stream to be decrypted
- Throws:
java.io.IOException
java.security.GeneralSecurityException
SmartDecryptingInputStream
public SmartDecryptingInputStream(CryptoStreamFactory cryptoStreamFactory,
java.io.InputStream is,
char[] password)
throws java.io.IOException,
java.security.GeneralSecurityException
- Constructor
- Parameters:
cryptoStreamFactory
- the CryptoStreamFactory for creating a cipher streamis
- the input stream to be decryptedpassword
- the password for decryption
- Throws:
java.io.IOException
java.security.GeneralSecurityException
copy
public void copy(java.io.InputStream is,
java.io.OutputStream os)
throws java.io.IOException
- Pumps the input stream to the output stream.
- Parameters:
is
- the source input streamos
- the target output stream
- Throws:
java.io.IOException
- the copying failed
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.