public class Base32 extends BaseNCodec
The class can be parameterized in the following manner with various constructors:
This class operates directly on byte streams, and not character streams.
This class is thread-safe.
You can configure instances with the Base32.Builder.
Base32 base32 = Base32.builder()
.setDecodingPolicy(DecodingPolicy.LENIENT) // default is lenient
.setEncodeTable(customEncodeTable)
.setLineLength(0) // default is none
.setLineSeparator('\r', '\n') // default is CR LF
.setPadding('=') // default is =
.get()
| Modifier and Type | Class and Description |
|---|---|
static class |
Base32.Builder
Builds
Base32 instances. |
BaseNCodec.AbstractBuilder<T,B extends BaseNCodec.AbstractBuilder<T,B>>MIME_CHUNK_SIZE, PEM_CHUNK_SIZE| Constructor and Description |
|---|
Base32()
Constructs a Base32 codec used for decoding and encoding.
|
Base32(boolean useHex)
Constructs a Base32 codec used for decoding and encoding.
|
Base32(boolean useHex,
byte padding)
Constructs a Base32 codec used for decoding and encoding.
|
Base32(byte pad)
Constructs a Base32 codec used for decoding and encoding.
|
Base32(int lineLength)
Constructs a Base32 codec used for decoding and encoding.
|
Base32(int lineLength,
byte[] lineSeparator)
Constructs a Base32 codec used for decoding and encoding.
|
Base32(int lineLength,
byte[] lineSeparator,
boolean useHex)
Constructs a Base32 / Base32 Hex codec used for decoding and encoding.
|
Base32(int lineLength,
byte[] lineSeparator,
boolean useHex,
byte padding)
Constructs a Base32 / Base32 Hex codec used for decoding and encoding.
|
Base32(int lineLength,
byte[] lineSeparator,
boolean useHex,
byte padding,
CodecPolicy decodingPolicy)
Constructs a Base32 / Base32 Hex codec used for decoding and encoding.
|
| Modifier and Type | Method and Description |
|---|---|
static Base32.Builder |
builder()
Creates a new Builder.
|
boolean |
isInAlphabet(byte octet)
Returns whether or not the
octet is in the Base32 alphabet. |
decode, decode, decode, encode, encode, encode, encodeAsString, encodeToString, getChunkSeparator, getCodecPolicy, getEncodedLength, isInAlphabet, isInAlphabet, isStrictDecodingpublic Base32()
When encoding the line length is 0 (no chunking).
public Base32(boolean useHex)
When encoding the line length is 0 (no chunking).
useHex - if true then use Base32 Hex alphabetpublic Base32(boolean useHex,
byte padding)
When encoding the line length is 0 (no chunking).
useHex - if true then use Base32 Hex alphabetpadding - byte used as padding byte.public Base32(byte pad)
When encoding the line length is 0 (no chunking).
pad - byte used as padding byte.public Base32(int lineLength)
When encoding the line length is given in the constructor, the line separator is CRLF.
lineLength - Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of 8). If lineLength <= 0, then
the output will not be divided into lines (chunks). Ignored when decoding.public Base32(int lineLength,
byte[] lineSeparator)
When encoding the line length and line separator are given in the constructor.
Line lengths that aren't multiples of 8 will still essentially end up being multiples of 8 in the encoded data.
lineLength - Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of 8). If lineLength <= 0,
then the output will not be divided into lines (chunks). Ignored when decoding.lineSeparator - Each line of encoded data will end with this sequence of bytes.java.lang.IllegalArgumentException - Thrown when the lineSeparator contains Base32 characters.public Base32(int lineLength,
byte[] lineSeparator,
boolean useHex)
When encoding the line length and line separator are given in the constructor.
Line lengths that aren't multiples of 8 will still essentially end up being multiples of 8 in the encoded data.
lineLength - Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of 8). If lineLength <= 0,
then the output will not be divided into lines (chunks). Ignored when decoding.lineSeparator - Each line of encoded data will end with this sequence of bytes.useHex - if true, then use Base32 Hex alphabet, otherwise use Base32 alphabetjava.lang.IllegalArgumentException - Thrown when the lineSeparator contains Base32 characters. Or the lineLength > 0 and lineSeparator is null.public Base32(int lineLength,
byte[] lineSeparator,
boolean useHex,
byte padding)
When encoding the line length and line separator are given in the constructor.
Line lengths that aren't multiples of 8 will still essentially end up being multiples of 8 in the encoded data.
lineLength - Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of 8). If lineLength <= 0,
then the output will not be divided into lines (chunks). Ignored when decoding.lineSeparator - Each line of encoded data will end with this sequence of bytes.useHex - if true, then use Base32 Hex alphabet, otherwise use Base32 alphabetpadding - padding byte.java.lang.IllegalArgumentException - Thrown when the lineSeparator contains Base32 characters. Or the lineLength > 0 and lineSeparator is null.public Base32(int lineLength,
byte[] lineSeparator,
boolean useHex,
byte padding,
CodecPolicy decodingPolicy)
When encoding the line length and line separator are given in the constructor.
Line lengths that aren't multiples of 8 will still essentially end up being multiples of 8 in the encoded data.
lineLength - Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of 8). If lineLength <= 0,
then the output will not be divided into lines (chunks). Ignored when decoding.lineSeparator - Each line of encoded data will end with this sequence of bytes.useHex - if true, then use Base32 Hex alphabet, otherwise use Base32 alphabetpadding - padding byte.decodingPolicy - The decoding policy.java.lang.IllegalArgumentException - Thrown when the lineSeparator contains Base32 characters. Or the lineLength > 0 and lineSeparator is null.public static Base32.Builder builder()
public boolean isInAlphabet(byte octet)
octet is in the Base32 alphabet.octet - The value to testtrue if the value is defined in the Base32 alphabet false otherwise.Copyright © 2010 - 2024 Adobe. All Rights Reserved