Class ZappyBase64StringDecoder

java.lang.Object
com.glitchybyte.zappy.ZappyBase64StringDecoder
Direct Known Subclasses:
ZappyDecoder

public class ZappyBase64StringDecoder extends Object
Base64 string decoder.
  • Constructor Details

    • ZappyBase64StringDecoder

      public ZappyBase64StringDecoder()
      Creates a Zappy base64 decoder.
  • Method Details

    • base64StringDecode

      public String base64StringDecode(String str) throws ZappyParseException
      Decodes a base64 string.

      Expects encoding with "-" and "_", and no padding.

      Parameters:
      str - Base64 string.
      Returns:
      The decoded string.
      Throws:
      ZappyParseException - if it's an invalid base64 string.
    • base64AlphabetToBytes

      protected byte[] base64AlphabetToBytes(String str) throws ZappyParseException
      Converts a base64 string into decoded bytes.
      Parameters:
      str - Base64 string.
      Returns:
      Decoded bytes.
      Throws:
      ZappyParseException - if it's an invalid base64 string.