Package org.apache.axiom.util.base64

# Class Base64Utils

java.lang.Object
org.apache.axiom.util.base64.Base64Utils

public class Base64Utils extends Object
Contains utility methods to work with base64 encoded data.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Base64Utils()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static byte[]`
  `decode(char[] data, int off, int len)`
  Deprecated.
  `static void`
  `decode(char[] data, int off, int len, OutputStream ostream)`
  Deprecated.
  `static byte[]`
  `decode(String data)`
  Decodes a base64 encoded string into a byte array.
  `static void`
  `decode(String data, OutputStream ostream)`
  Deprecated.
  `static String`
  `encode(byte[] data)`
  Deprecated.
  `static String`
  `encode(byte[] data, int off, int len)`
  Deprecated.
  `static void`
  `encode(byte[] data, int off, int len, OutputStream ostream)`
  Deprecated.
  `static void`
  `encode(byte[] data, int off, int len, Writer writer)`
  Deprecated.
  `static void`
  `encode(byte[] data, int off, int len, StringBuffer buffer)`
  Deprecated.
  `static String`
  `encode(Blob blob)`
  Get a base64 representation of the content of a given `Blob` as a string.
  `static char[]`
  `encodeToCharArray(Blob blob)`
  Get a base64 representation of the content of a given `Blob` as a char array.
  `static boolean`
  `isValidBase64Encoding(String data)`
  Deprecated.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Base64Utils

    public Base64Utils()

- ## Method Details

  - ### encode

    public static String encode(Blob blob) throws IOException
    Get a base64 representation of the content of a given `Blob` as a string. This method will try to carry out the encoding operation in the most efficient way.
    Parameters:
      `blob` - the blob with the content to encode
    Returns:
      the base64 encoded content
    Throws:
      `IOException` - if an I/O error occurs when reading the content of the blob

  - ### encodeToCharArray

    public static char[] encodeToCharArray(Blob blob) throws IOException
    Get a base64 representation of the content of a given `Blob` as a char array. This method will try to carry out the encoding operation in the most efficient way.
    Parameters:
      `blob` - the blob with the content to encode
    Returns:
      the base64 encoded content
    Throws:
      `IOException` - if an I/O error occurs when reading the content of the blob

  - ### decode

    public static byte[] decode(char[] data, int off, int len)
    Deprecated.

  - ### decode

    public static byte[] decode(String data)
    Decodes a base64 encoded string into a byte array. This method is designed to conform to the XML Schema specification. It can be used to decode the text content of an element (or the value of an attribute) of type `base64Binary`.
    Parameters:
      `data` - the base64 encoded data
    Returns:
      the decoded data

  - ### isValidBase64Encoding

    public static boolean isValidBase64Encoding(String data)
    Deprecated.

  - ### decode

    public static void decode(char[] data, int off, int len, OutputStream ostream) throws IOException
    Deprecated.
    Throws:
      `IOException`

  - ### decode

    public static void decode(String data, OutputStream ostream) throws IOException
    Deprecated.
    Throws:
      `IOException`

  - ### encode

    public static String encode(byte[] data)
    Deprecated.

  - ### encode

    public static String encode(byte[] data, int off, int len)
    Deprecated.

  - ### encode

    public static void encode(byte[] data, int off, int len, StringBuffer buffer)
    Deprecated.

  - ### encode

    public static void encode(byte[] data, int off, int len, OutputStream ostream) throws IOException
    Deprecated.
    Throws:
      `IOException`

  - ### encode

    public static void encode(byte[] data, int off, int len, Writer writer) throws IOException
    Deprecated.
    Throws:
      `IOException`