net.sf.okapi.common

## Class Base64

- java.lang.Object
- - net.sf.okapi.common.Base64

- Deprecated.
  Use the `Base64`, available since JDK 8

      @Deprecated
      public class Base64
      extends java.lang.Object

  Base64 Encoder/Decoder for all VM.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Base64()` Deprecated.

  - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static byte[]` | `decode(char[] data)` Deprecated. Decodes a byte array from Base64 format.
    `static byte[]` | `decode(java.lang.String str)` Deprecated. Decodes a byte array from Base64 format.
    `static java.lang.String` | `decodePassword(java.lang.String password)` Deprecated. Decode a string value that is possibly encoded into a clear string.
    `static java.lang.String` | `decodeString(java.lang.String str)` Deprecated. Decodes a string from a UTF-8 Base64 string.
    `static char[]` | `encode(byte[] data)` Deprecated. Encodes a byte array into Base64 format.
    `static char[]` | `encode(byte[] data, int iLen)` Deprecated. Encodes a byte array into Base64 format.
    `static java.lang.String` | `encode(java.io.InputStream is)` Deprecated.
    `static java.lang.String` | `encodePassword(java.lang.String password)` Deprecated. Encode a password-type string value.
    `static java.lang.String` | `encodeString(java.lang.String str)` Deprecated. Encodes a string into UTF-8 Base64 format.

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

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

- - ### Constructor Detail

    - #### Base64

          public Base64()

      Deprecated.

  - ### Method Detail

    - #### encodeString

          public static java.lang.String encodeString(java.lang.String str)

      Deprecated.
      Encodes a string into UTF-8 Base64 format. No blanks or line breaks are inserted.
      Parameters:
        `str` - the String to be encoded.
      Returns:
        the String with the Base64 encoded data.

    - #### encode

          public static char[] encode(byte[] data)

      Deprecated.
      Encodes a byte array into Base64 format. No blanks or line breaks are inserted.
      Parameters:
        `data` - the array containing the data bytes to be encoded.
      Returns:
        the character array with the Base64 encoded data.

    - #### encode

          public static char[] encode(byte[] data,
                                      int iLen)

      Deprecated.
      Encodes a byte array into Base64 format. No blanks or line breaks are inserted.
      Parameters:
        `data` - the array containing the data bytes to be encoded.
        `iLen` - the number of bytes to process in `in`.
      Returns:
        the character array with the Base64 encoded data.

    - #### decodeString

          public static java.lang.String decodeString(java.lang.String str)

      Deprecated.
      Decodes a string from a UTF-8 Base64 string. The coded string may have line breaks.
      Parameters:
        `str` - the Base64 String to be decoded.
      Returns:
        the String containing the decoded data.
      Throws:
        `java.lang.IllegalArgumentException` - if the input is not valid Base64 encoded data.

    - #### decode

          public static byte[] decode(java.lang.String str)

      Deprecated.
      Decodes a byte array from Base64 format. The coded string may have line breaks.
      Parameters:
        `str` - the Base64 String to be decoded.
      Returns:
        the array containing the decoded data bytes.
      Throws:
        `java.lang.IllegalArgumentException` - if the input is not valid Base64 encoded data.

    - #### decode

          public static byte[] decode(char[] data)

      Deprecated.
      Decodes a byte array from Base64 format. No blanks or line breaks are allowed within the Base64 encoded data.
      Parameters:
        `data` - the character array containing the Base64 encoded data.
      Returns:
        the array containing the decoded data bytes.
      Throws:
        `java.lang.IllegalArgumentException` - if the input is not valid Base64 encoded data.

    - #### encode

          public static java.lang.String encode(java.io.InputStream is)

      Deprecated.

    - #### encodePassword

          public static java.lang.String encodePassword(java.lang.String password)

      Deprecated.
      Encode a password-type string value.
      Parameters:
        `password` - the password (in clear).
      Returns:
        the masked value for the given string.
      See Also:
        `decodePassword(String)`

    - #### decodePassword

          public static java.lang.String decodePassword(java.lang.String password)

      Deprecated.
      Decode a string value that is possibly encoded into a clear string.
      Parameters:
        `password` - the string to decode. It may be a clear string too.
      Returns:
        the decoded string.