程序包 com.ajaxjs.util

类 Base64Utils

java.lang.Object
com.ajaxjs.util.Base64Utils

public class Base64Utils extends Object
Base64 encode/decode
  • 构造器详细资料

    • Base64Utils

      public Base64Utils(byte[] input)
    • Base64Utils

      public Base64Utils(String input)
    • Base64Utils

      public Base64Utils(String input, Charset charset)
  • 方法详细资料

    • encode

      public byte[] encode()
      Encode the input then returns the result in bytes
      返回:
      The result in bytes.
    • encodeAsString

      public String encodeAsString()
      Decode the input in BASE64 then returns the string. Charset ISO_8859_1 is enough for BASE64 result.
      返回:
      The result in string.
    • decode

      public byte[] decode()
      Decode the input then returns the result in bytes
      返回:
      The result in bytes.
    • decodeAsString

      public String decodeAsString(Charset charset)
      Decode the input in BASE64 then returns the string with specified charset
      参数:
      charset - you can specify the charset of the result
      返回:
      The result in string.
    • decodeAsString

      public String decodeAsString()
      Decode the input in BASE64 then returns the string in UTF-8 charset
      返回:
      The result in string.
    • formatBase64String

      public static String formatBase64String(String base64)
      格式化 Base64 字符串,每 64 个字符换行