Package org.pgpainless.encryption_signing

# Class EncryptionStream

java.lang.Object
java.io.OutputStream
org.pgpainless.encryption_signing.EncryptionStream

All Implemented Interfaces:
  `Closeable`, `Flushable`, `AutoCloseable`

public final class EncryptionStream extends OutputStream
OutputStream that produces an OpenPGP message. The message can be encrypted, signed, or both, depending on its configuration. This class is based upon Jens Neuhalfen's Bouncy-GPG PGPEncryptingStream.

See Also:
  - Source

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`void`
`flush()`
`EncryptionResult`
`getResult()`
`boolean`
`isClosed()`
`void`
`prepareInputEncoding()`
`void`
`prepareSigningStream()`
`void`
`write(byte[] buffer)`
`void`
`write(byte[] buffer, int off, int len)`
`void`
`write(int data)`

### Methods inherited from class java.io.OutputStream

`nullOutputStream`

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

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

## Method Details

### prepareSigningStream

public void prepareSigningStream()

### prepareInputEncoding

public void prepareInputEncoding()

### write

public void write(int data) throws IOException

Specified by:
  `write` in class `OutputStream`
Throws:
  `IOException`

### write

public void write(@Nonnull byte[] buffer) throws IOException

Overrides:
  `write` in class `OutputStream`
Throws:
  `IOException`

### write

public void write(@Nonnull byte[] buffer, int off, int len) throws IOException

Overrides:
  `write` in class `OutputStream`
Throws:
  `IOException`

### flush

public void flush() throws IOException

Specified by:
  `flush` in interface `Flushable`
Overrides:
  `flush` in class `OutputStream`
Throws:
  `IOException`

### close

public void close() throws IOException

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Overrides:
  `close` in class `OutputStream`
Throws:
  `IOException`

### getResult

public EncryptionResult getResult()

### isClosed

public boolean isClosed()