Class BASE64Coder

java.lang.Object
ecmwf.common.text.BASE64Coder

public class BASE64Coder extends Object
The Class BASE64Coder.
Author:
root
  • Method Details

    • encodeString

      public static String encodeString(String s)
      Encodes a string into BASE64 format. No blanks or line breaks are inserted.
      Parameters:
      s - a String to be encoded.
      Returns:
      A String with the BASE64 encoded data.
    • encode

      public static char[] encode(byte[] in)
      Encodes a byte array into BASE64 format. No blanks or line breaks are inserted.
      Parameters:
      in - an array containing the data bytes to be encoded.
      Returns:
      A character array with the BASE64 encoded data.
    • encode

      public static char[] encode(byte[] in, int iLen)
      Encodes a byte array into BASE64 format. No blanks or line breaks are inserted.
      Parameters:
      in - an array containing the data bytes to be encoded.
      iLen - number of bytes to process in in.
      Returns:
      A character array with the BASE64 encoded data.
    • decodeString

      public static String decodeString(String s)
      Decodes a string from BASE64 format.
      Parameters:
      s - a BASE64 String to be decoded.
      Returns:
      A String containing the decoded data.
      Throws:
      IllegalArgumentException - if the input is not valid BASE64 encoded data.
    • decode

      public static byte[] decode(String s)
      Decodes a byte array from BASE64 format.
      Parameters:
      s - a BASE64 String to be decoded.
      Returns:
      An array containing the decoded data bytes.
      Throws:
      IllegalArgumentException - if the input is not valid BASE64 encoded data.
    • decode

      public static byte[] decode(char[] in)
      Decodes a byte array from BASE64 format. No blanks or line breaks are allowed within the BASE64 encoded data.
      Parameters:
      in - a character array containing the BASE64 encoded data.
      Returns:
      An array containing the decoded data bytes.
      Throws:
      IllegalArgumentException - if the input is not valid BASE64 encoded data.