Class Base64Encoder

All Implemented Interfaces:
Encoder

public class Base64Encoder extends AbstractBaseNEncoder
Stateful base 64 encoder with support for configurable line breaks.
Author:
Middleware Services
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Builder for base-64 encoders.
  • Field Summary

    Fields inherited from class org.cryptacular.codec.AbstractBaseNEncoder

    lineLength
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance that produces base 64-encoded output with no line breaks in the default character set.
    Base64Encoder(boolean urlSafe)
    Creates a new instance that produces base 64-encoded output with no line breaks and optional URL-safe character set.
    Base64Encoder(boolean urlSafe, int charactersPerLine)
    Creates a new instance that produces base 64-encoded output with the given number of characters per line with the option of URL-safe character set.
    Base64Encoder(int charactersPerLine)
    Creates a new instance that produces base 64-encoded output with the given number of characters per line in the default character set.
    Creates a new instance that produces base 64-encoded output with the given 64-character alphabet.
    Base64Encoder(String alphabet, int charactersPerLine)
    Creates a new instance that produces base 64-encoded output with the given 64-character alphabet with line wrapping at the specified line length;
  • Method Summary

    Modifier and Type
    Method
    Description
    protected int
     
    protected int
     

    Methods inherited from class org.cryptacular.codec.AbstractBaseNEncoder

    encode, encodingTable, finalize, isPaddedOutput, outputSize, setPaddedOutput

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Base64Encoder

      public Base64Encoder()
      Creates a new instance that produces base 64-encoded output with no line breaks in the default character set.
    • Base64Encoder

      public Base64Encoder(boolean urlSafe)
      Creates a new instance that produces base 64-encoded output with no line breaks and optional URL-safe character set.
      Parameters:
      urlSafe - True to use URL and filesystem-safe character set, false otherwise.
    • Base64Encoder

      public Base64Encoder(int charactersPerLine)
      Creates a new instance that produces base 64-encoded output with the given number of characters per line in the default character set.
      Parameters:
      charactersPerLine - Number of characters per line. A zero or negative value disables line breaks.
    • Base64Encoder

      public Base64Encoder(boolean urlSafe, int charactersPerLine)
      Creates a new instance that produces base 64-encoded output with the given number of characters per line with the option of URL-safe character set.
      Parameters:
      urlSafe - True to use URL and filesystem-safe character set, false otherwise.
      charactersPerLine - Number of characters per line. A zero or negative value disables line breaks.
    • Base64Encoder

      public Base64Encoder(String alphabet)
      Creates a new instance that produces base 64-encoded output with the given 64-character alphabet.
      Parameters:
      alphabet - 64-character alphabet to use.
    • Base64Encoder

      public Base64Encoder(String alphabet, int charactersPerLine)
      Creates a new instance that produces base 64-encoded output with the given 64-character alphabet with line wrapping at the specified line length;
      Parameters:
      alphabet - 64-character alphabet to use.
      charactersPerLine - Number of characters per line. A zero or negative value disables line breaks.
  • Method Details