Package 

Class Base32Encoding


  • 
    public class Base32Encoding
    
                        

    This 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 !

    • 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
      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.
      ByteArrayOutputStream decode(String srcString) Decode the input string {@param srcString} and writes the resulting bytes to a new ByteArrayOutputStream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 bytes
        src - The input bytes to encode.