|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.codec.binary.BaseNCodec org.apache.commons.codec.binary.Base32
public class Base32
Provides Base32 encoding and decoding as defined by RFC 4648.
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.
Field Summary |
---|
Fields inherited from class org.apache.commons.codec.binary.BaseNCodec |
---|
lineLength, MASK_8BITS, MIME_CHUNK_SIZE, PAD, PAD_DEFAULT, PEM_CHUNK_SIZE |
Constructor Summary | |
---|---|
Base32()
Creates a Base32 codec used for decoding and encoding. |
|
Base32(boolean useHex)
Creates a Base32 codec used for decoding and encoding. |
|
Base32(int lineLength)
Creates a Base32 codec used for decoding and encoding. |
|
Base32(int lineLength,
byte[] lineSeparator)
Creates a Base32 codec used for decoding and encoding. |
|
Base32(int lineLength,
byte[] lineSeparator,
boolean useHex)
Creates a Base32 / Base32 Hex codec used for decoding and encoding. |
Method Summary | |
---|---|
boolean |
isInAlphabet(byte octet)
Returns whether or not the octet is in the Base32 alphabet. |
Methods inherited from class org.apache.commons.codec.binary.BaseNCodec |
---|
containsAlphabetOrPad, decode, decode, decode, encode, encode, encodeAsString, encodeToString, ensureBufferSize, getDefaultBufferSize, getEncodedLength, isInAlphabet, isInAlphabet, isWhiteSpace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public 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(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 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 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.
IllegalArgumentException
- The provided lineSeparator included some Base32 characters. That's not going to work!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 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 alphabet
IllegalArgumentException
- The provided lineSeparator included some Base32 characters. That's not going to work! Or the
lineLength > 0 and lineSeparator is null.Method Detail |
---|
public boolean isInAlphabet(byte octet)
octet
is in the Base32 alphabet.
isInAlphabet
in class BaseNCodec
octet
- The value to test
true
if the value is defined in the the Base32 alphabet false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |