Package org.pgpainless.util

# Class ArmoredOutputStreamFactory

java.lang.Object
org.pgpainless.util.ArmoredOutputStreamFactory

public final class ArmoredOutputStreamFactory extends Object
Factory to create configured `ArmoredOutputStreams`. The configuration entails setting custom version and comment headers.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`PGPAINLESS`
Name of the program.

## Method Summary

Modifier and Type
Method
Description
`static org.bouncycastle.bcpg.ArmoredOutputStream`
`get(OutputStream outputStream)`
Wrap an `OutputStream` inside a preconfigured `ArmoredOutputStream`.
`static org.bouncycastle.bcpg.ArmoredOutputStream`
`get(OutputStream outputStream, ProducerOptions options)`
Return an instance of the `ArmoredOutputStream` which might have pre-populated armor headers.
`static void`
`resetComment()`
Reset to the default of no comment headers.
`static void`
`resetVersionInfo()`
Reset the version header to its default value of `PGPAINLESS`.
`static void`
`setComment(String commentString)`
Set a comment header value in the ASCII armor header.
`static void`
`setVersionInfo(String versionString)`
Overwrite the version header of ASCII armors with a custom value.

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

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

## Field Details

### PGPAINLESS

public static final String PGPAINLESS
Name of the program.

See Also:
  - Constant Field Values

## Method Details

### get

@Nonnull public static org.bouncycastle.bcpg.ArmoredOutputStream get(@Nonnull OutputStream outputStream)
Wrap an `OutputStream` inside a preconfigured `ArmoredOutputStream`.

Parameters:
  `outputStream` - inner stream
Returns:
  armored output stream

### get

@Nonnull public static org.bouncycastle.bcpg.ArmoredOutputStream get(@Nonnull OutputStream outputStream, @Nonnull ProducerOptions options)
Return an instance of the `ArmoredOutputStream` which might have pre-populated armor headers.

Parameters:
  `outputStream` - output stream
  `options` - options
Returns:
  armored output stream

### setVersionInfo

public static void setVersionInfo(@Nullable String versionString)
Overwrite the version header of ASCII armors with a custom value. Newlines in the version info string result in multiple version header entries. If this is set to

    null

, then the version header is omitted altogether.

Parameters:
  `versionString` - version string

### resetVersionInfo

public static void resetVersionInfo()
Reset the version header to its default value of `PGPAINLESS`.

### setComment

public static void setComment(@Nullable String commentString)
Set a comment header value in the ASCII armor header. If the comment contains newlines, it will be split into multiple header entries.

Parameters:
  `commentString` - comment
See Also:
  - `for how to set comments for individual messages.`

### resetComment

public static void resetComment()
Reset to the default of no comment headers.