Class InMemoryMultiPassStrategy
java.lang.Object
org.pgpainless.decryption_verification.cleartext_signatures.InMemoryMultiPassStrategy
- All Implemented Interfaces:
MultiPassStrategy
Implementation of the
MultiPassStrategy
.
This class keeps the read data in memory by caching the data inside a ByteArrayOutputStream
.
Note, that this class is suitable and efficient for processing small amounts of data.
For larger data like encrypted files, use of the WriteToFileMultiPassStrategy
is recommended to
prevent OutOfMemoryErrors
and other issues.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getBytes()
Provide anInputStream
which contains the data that was previously written away inMultiPassStrategy.getMessageOutputStream()
.Provide anOutputStream
into which the signed data can be read into.
-
Constructor Details
-
InMemoryMultiPassStrategy
public InMemoryMultiPassStrategy()
-
-
Method Details
-
getMessageOutputStream
Description copied from interface:MultiPassStrategy
Provide anOutputStream
into which the signed data can be read into.- Specified by:
getMessageOutputStream
in interfaceMultiPassStrategy
- Returns:
- output stream
-
getMessageInputStream
Description copied from interface:MultiPassStrategy
Provide anInputStream
which 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:
getMessageInputStream
in interfaceMultiPassStrategy
- Returns:
- input stream
-
getBytes
public byte[] getBytes()
-