Package org.pgpainless.decryption_verification.cleartext_signatures

# 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 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
Constructor
Description
`InMemoryMultiPassStrategy()`

## Method Summary

Modifier and Type
Method
Description
`byte[]`
`getBytes()`
`ByteArrayInputStream`
`getMessageInputStream()`
Provide an `InputStream` which contains the data that was previously written away in `MultiPassStrategy.getMessageOutputStream()`.
`ByteArrayOutputStream`
`getMessageOutputStream()`
Provide an `OutputStream` into which the signed data can be read into.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### InMemoryMultiPassStrategy

public InMemoryMultiPassStrategy()

## Method Details

### getMessageOutputStream

public ByteArrayOutputStream getMessageOutputStream()
Description copied from interface: `MultiPassStrategy`
Provide an `OutputStream` into which the signed data can be read into.

Specified by:
  `getMessageOutputStream` in interface `MultiPassStrategy`
Returns:
  output stream

### getMessageInputStream

public ByteArrayInputStream getMessageInputStream()
Description copied from interface: `MultiPassStrategy`
Provide an `InputStream` which contains the data that was previously written away in `MultiPassStrategy.getMessageOutputStream()`. As there may be multiple signatures that need to be processed, each call of this method MUST return a new `InputStream`.

Specified by:
  `getMessageInputStream` in interface `MultiPassStrategy`
Returns:
  input stream

### getBytes

public byte[] getBytes()