Class WriteToFileMultiPassStrategy
java.lang.Object
org.pgpainless.decryption_verification.cleartext_signatures.WriteToFileMultiPassStrategy
- All Implemented Interfaces:
MultiPassStrategy
Implementation of the
MultiPassStrategy.
When processing signed data the first time, the data is being written out into a file.
For the second pass, that file is being read again.
This strategy is recommended when larger amounts of data need to be processed.
For smaller files, InMemoryMultiPassStrategy yields higher efficiency.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionProvide anInputStreamwhich contains the data that was previously written away inMultiPassStrategy.getMessageOutputStream().Provide anOutputStreaminto which the signed data can be read into.
-
Constructor Details
-
WriteToFileMultiPassStrategy
Create aMultiPassStrategywhich writes data to a file. Note thatgetMessageOutputStream()will create the file if necessary.- Parameters:
file- file to write the data to and read from
-
-
Method Details
-
getMessageOutputStream
Description copied from interface:MultiPassStrategyProvide anOutputStreaminto which the signed data can be read into.- Specified by:
getMessageOutputStreamin interfaceMultiPassStrategy- Returns:
- output stream
- Throws:
IOException- io error
-
getMessageInputStream
Description copied from interface:MultiPassStrategyProvide anInputStreamwhich contains the data that was previously written away inMultiPassStrategy.getMessageOutputStream(). As there may be multiple signatures that need to be processed, each call of this method MUST return a newInputStream.- Specified by:
getMessageInputStreamin interfaceMultiPassStrategy- Returns:
- input stream
- Throws:
IOException- io error
-