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 theWriteToFileMultiPassStrategyis recommended to preventOutOfMemoryErrorsand other issues.
-
-
Constructor Summary
Constructors Constructor Description InMemoryMultiPassStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getBytes()ByteArrayInputStreamgetMessageInputStream()Provide anInputStreamwhich contains the data that was previously written away inMultiPassStrategy.getMessageOutputStream().ByteArrayOutputStreamgetMessageOutputStream()Provide anOutputStreaminto which the signed data can be read into.
-
-
-
Constructor Detail
-
InMemoryMultiPassStrategy
public InMemoryMultiPassStrategy()
-
-
Method Detail
-
getMessageOutputStream
public ByteArrayOutputStream getMessageOutputStream()
Description copied from interface:MultiPassStrategyProvide anOutputStreaminto which the signed data can be read into.- Specified by:
getMessageOutputStreamin interfaceMultiPassStrategy- Returns:
- output stream
-
getMessageInputStream
public ByteArrayInputStream 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
-
getBytes
public byte[] getBytes()
-
-