Class ArmoredOutputStream.Builder

  • Enclosing class:
    ArmoredOutputStream

    public static class ArmoredOutputStream.Builder
    extends java.lang.Object
    • Method Detail

      • setVersion

        public ArmoredOutputStream.Builder setVersion​(java.lang.String version)
        Set a
        Version:
        header. Note: Adding version headers to ASCII armored output is discouraged to minimize metadata.
        Parameters:
        version - version
        Returns:
        builder
      • setComment

        public ArmoredOutputStream.Builder setComment​(java.lang.String comment)
        Replace the
        Comment:
        header field with the given comment. If the comment contains newlines, multiple headers will be added, one for each newline. If the comment is
        null
        , then the output will contain no comments.
        Parameters:
        comment - comment
        Returns:
        builder
      • setMessageId

        public ArmoredOutputStream.Builder setMessageId​(java.lang.String messageId)
        Replace the
        MessageID:
        header field with the given messageId.
        Parameters:
        messageId - message ID
        Returns:
        builder
      • setCharset

        public ArmoredOutputStream.Builder setCharset​(java.lang.String charset)
        Replace the
        Charset:
        header with the given value.
        Parameters:
        charset - charset
        Returns:
        builder
      • addComment

        public ArmoredOutputStream.Builder addComment​(java.lang.String comment)
        Add the given value as one or more additional
        Comment:
        headers to the already present comments. If the comment contains newlines, multiple headers will be added, one for each newline. If the comment is
        null
        , this method does nothing.
        Parameters:
        comment - comment
        Returns:
        builder
      • enableCRC

        public ArmoredOutputStream.Builder enableCRC​(boolean doComputeCRC)
        Enable calculation and inclusion of the CRC check sum (default is true).
        Parameters:
        doComputeCRC - true if CRC to be included, false otherwise.
        Returns:
        the current builder instance.