Class ImaBase64

Object
com.ibm.ima.plugin.util.ImaBase64

public class ImaBase64 extends Object
The ImaBase64 class is used to convert byte arrays to and from base64 strings.

The ImaBase64 class provides static methods for efficient between byte arrays and base64 strings.

  • Field Details

  • Method Details

    • toBase64

      public static String toBase64(byte[] from)
      Convert a byte array to a base64 string.
      Parameters:
      from - The source byte array
      Returns:
      A string in base64. This is always a multiple of 4 bytes.
    • fromBase64

      public static byte[] fromBase64(String from)
      Convert from a base64 string to a byte array.
      Parameters:
      from - The input string in base64 which must be a multiple of 4 bytes
      Returns:
      The byte array or null to indicate the string is not valid base64