-
public class Base32EncodingThis class implements base32 encoding and decoding
This implementation is not suitable as a general-purpose base32 encoding/decoding because it is tailor-made for use with typed identifiers; this means we always encode 20 bytes and therefore we _do not_ handle padding !
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classBase32Encoding.EncodeExceptionpublic classBase32Encoding.DecodeException
-
Constructor Summary
Constructors Constructor Description Base32Encoding(String encoder)Construct a new Base32Encoding using {@param encoder} as the encoding alphabet.
-
Method Summary
Modifier and Type Method Description voidencode(ByteArrayOutputStream outputStream, Array<byte> src)Encode the input bytes {@param src} to the output stream {@param outputStream}.This method does _not_ handle padding, therefore {@param src} must have a length that is a multiple of 5. ByteArrayOutputStreamdecode(String srcString)Decode the input string {@param srcString} and writes the resulting bytes to a new ByteArrayOutputStream. -
-
Constructor Detail
-
Base32Encoding
Base32Encoding(String encoder)
Construct a new Base32Encoding using {@param encoder} as the encoding alphabet.- Parameters:
encoder- The encoding alphabet (must be 32 chars)
-
-
Method Detail
-
encode
void encode(ByteArrayOutputStream outputStream, Array<byte> src)
Encode the input bytes {@param src} to the output stream {@param outputStream}.This method does _not_ handle padding, therefore {@param src} must have a length that is a multiple of 5.
- Parameters:
outputStream- The output stream where we will write the encoded bytessrc- The input bytes to encode.
-
decode
ByteArrayOutputStream decode(String srcString)
Decode the input string {@param srcString} and writes the resulting bytes to a new ByteArrayOutputStream.
- Parameters:
srcString- The input string to decode
-
-
-
-