Class InMemoryMultiPassStrategy
- java.lang.Object
-
- org.pgpainless.decryption_verification.cleartext_signatures.InMemoryMultiPassStrategy
-
- All Implemented Interfaces:
MultiPassStrategy
public class InMemoryMultiPassStrategy extends Object implements MultiPassStrategy
Implementation of theMultiPassStrategy
. This class keeps the read data in memory by caching the data inside aByteArrayOutputStream
. Note, that this class is suitable and efficient for processing small amounts of data. For larger data like encrypted files, use of theWriteToFileMultiPassStrategy
is recommended to preventOutOfMemoryErrors
and other issues.
-
-
Constructor Summary
Constructors Constructor Description InMemoryMultiPassStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getBytes()
ByteArrayInputStream
getMessageInputStream()
Provide anInputStream
which contains the data that was previously written away inMultiPassStrategy.getMessageOutputStream()
.ByteArrayOutputStream
getMessageOutputStream()
Provide anOutputStream
into which the signed data can be read into.
-
-
-
Constructor Detail
-
InMemoryMultiPassStrategy
public InMemoryMultiPassStrategy()
-
-
Method Detail
-
getMessageOutputStream
public ByteArrayOutputStream 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
public ByteArrayInputStream 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()
-
-