Package org.cryptacular.codec
Class Base64Codec
java.lang.Object
org.cryptacular.codec.Base64Codec
- All Implemented Interfaces:
Codec
Base 64 encoder/decoder pair.
- Author:
- Middleware Services
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance using the base-64 alphabet defined in RFC 4648.Base64Codec
(String alphabet) Creates a new instance using the given 64-character alphabet.Base64Codec
(String alphabet, boolean inputOutputPadding) Creates a new instance using the given 64-character alphabet with option to enable/disable padding. -
Method Summary
Modifier and TypeMethodDescription
-
Constructor Details
-
Base64Codec
public Base64Codec()Creates a new instance using the base-64 alphabet defined in RFC 4648. -
Base64Codec
Creates a new instance using the given 64-character alphabet.- Parameters:
alphabet
- 64-character alphabet to use.
-
Base64Codec
Creates a new instance using the given 64-character alphabet with option to enable/disable padding.- Parameters:
alphabet
- 64-character alphabet to use.inputOutputPadding
- True to enable support for padding, false otherwise.
-
-
Method Details
-
getEncoder
- Specified by:
getEncoder
in interfaceCodec
- Returns:
- The byte-to-char encoder of the codec pair.
-
getDecoder
- Specified by:
getDecoder
in interfaceCodec
- Returns:
- The char-to-byte decoder of the codec pair.
-
newEncoder
- Specified by:
newEncoder
in interfaceCodec
- Returns:
- A new instance of the byte-to-char encoder of the codec pair.
-
newDecoder
- Specified by:
newDecoder
in interfaceCodec
- Returns:
- A new instance of the char-to-byte decoder of the codec pair.
-