1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-27 06:42:05 +01:00

Add documentation to ArmoredOutputStreamFactory

This commit is contained in:
Paul Schaub 2021-08-15 13:41:07 +02:00
parent fd867bbfbe
commit 66293bf333
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -21,6 +21,7 @@ import org.bouncycastle.bcpg.ArmoredOutputStream;
/** /**
* Factory to create configured {@link ArmoredOutputStream ArmoredOutputStreams}. * Factory to create configured {@link ArmoredOutputStream ArmoredOutputStreams}.
* The configuration entails setting custom version and comment headers.
*/ */
public class ArmoredOutputStreamFactory { public class ArmoredOutputStreamFactory {
@ -28,6 +29,12 @@ public class ArmoredOutputStreamFactory {
private static String VERSION = PGPAINLESS; private static String VERSION = PGPAINLESS;
public static String[] COMMENT = new String[0]; public static String[] COMMENT = new String[0];
/**
* Wrap an {@link OutputStream} inside a preconfigured {@link ArmoredOutputStream}.
*
* @param outputStream inner stream
* @return armored output stream
*/
public static ArmoredOutputStream get(OutputStream outputStream) { public static ArmoredOutputStream get(OutputStream outputStream) {
ArmoredOutputStream armoredOutputStream = new ArmoredOutputStream(outputStream); ArmoredOutputStream armoredOutputStream = new ArmoredOutputStream(outputStream);
armoredOutputStream.setHeader(ArmorUtils.HEADER_VERSION, VERSION); armoredOutputStream.setHeader(ArmorUtils.HEADER_VERSION, VERSION);