Class Base64

java.lang.Object
overit.geocall.util.Base64

public class Base64 extends Object
Class that is used for base64 encoding and decoding
  • Constructor Details

    • Base64

      public Base64()
  • Method Details

    • encode

      public static final String encode(String s, boolean normalize)
      Parameters:
      s - The string to encode
      normalize - Boolean indicating if it should be normalized
      Returns:
      The encoded string
    • encode

      public static final String encode(String s, String charset, boolean normalize) throws UnsupportedEncodingException
      Parameters:
      s - The string to encode
      charset - The anme of a supported charset
      normalize - Boolean indicating if it should be normalized
      Returns:
      The encoded string
      Throws:
      UnsupportedEncodingException - If the character encoding is not supported
    • encode

      public static final String encode(byte[] d, boolean normalize)
      Parameters:
      d - An array of byte to encode
      normalize - Boolean indicating if it should be normalized
      Returns:
      The encoded string
    • encode

      public static final String encode(byte[] d, int n, boolean normalize)
      Parameters:
      d - An array of byte to encode
      n - The lenght of the encoding
      normalize - Boolean indicating if it should be normalized
      Returns:
      The encoded string
    • decode

      public static final byte[] decode(String str)
      Parameters:
      str - The string to decode
      Returns:
      An array of decoded bytes
    • decode

      public static final byte[] decode(byte[] data)
      Parameters:
      data - An array of bytes to decode
      Returns:
      THe decoded array of bytes