Class RFC1522BCodec

java.lang.Object
com.helger.base.codec.impl.AbstractRFC1522Codec
com.helger.base.codec.impl.RFC1522BCodec
All Implemented Interfaces:
ICodec<String>, IDecoder<String,String>, IEncoder<String,String>

public class RFC1522BCodec extends AbstractRFC1522Codec
Identical to the Base64 encoding defined by RFC 1521 and allows a character set to be specified.

RFC 1522 describes techniques to allow the encoding of non-ASCII text in various portions of a RFC 822 [2] message header, in a manner which is unlikely to confuse existing message handling software.

This class is immutable and thread-safe.

See Also:
  • Constructor Details

    • RFC1522BCodec

      public RFC1522BCodec()
      Default constructor with the UTF-8 charset.
    • RFC1522BCodec

      public RFC1522BCodec(@NonNull Charset aCharset)
      Constructor which allows for the selection of a default charset
      Parameters:
      aCharset - the default string charset to use.
  • Method Details

    • getRFC1522Encoding

      protected String getRFC1522Encoding()
      Description copied from class: AbstractRFC1522Codec
      Returns the codec name (referred to as encoding in the RFC 1522).
      Specified by:
      getRFC1522Encoding in class AbstractRFC1522Codec
      Returns:
      name of the codec
    • getEncoded

      @ReturnsMutableCopy protected byte @Nullable [] getEncoded(byte @Nullable [] aDecodedBuffer, @Nonnegative int nOfs, @Nonnegative int nLen)
      Specified by:
      getEncoded in class AbstractRFC1522Codec
    • getDecoded

      @ReturnsMutableCopy protected byte @Nullable [] getDecoded(byte @Nullable [] aEncodedBuffer, @Nonnegative int nOfs, @Nonnegative int nLen)
      Specified by:
      getDecoded in class AbstractRFC1522Codec