类 Base64Utils

java.lang.Object
cn.taketoday.util.Base64Utils

public abstract class Base64Utils extends Object
A simple utility class for Base64 encoding and decoding.

Adapts to Java 8's Base64 in a convenience fashion.

从以下版本开始:
4.0 2022/4/15 12:34
作者:
Juergen Hoeller, Gary Russell, Harry Yang
另请参阅:
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    static byte[]
    decode(byte[] src)
    Base64-decode the given byte array.
    static byte[]
    Base64-decode the given byte array from an UTF-8 String.
    static byte[]
    Base64-decode the given byte array from an UTF-8 String using the RFC 4648 "URL and Filename Safe Alphabet".
    static byte[]
    decodeUrlSafe(byte[] src)
    Base64-decode the given byte array using the RFC 4648 "URL and Filename Safe Alphabet".
    static byte[]
    encode(byte[] src)
    Base64-encode the given byte array.
    static String
    encodeToString(byte[] src)
    Base64-encode the given byte array to a String.
    static String
    Base64-encode the given byte array to a String using the RFC 4648 "URL and Filename Safe Alphabet".
    static byte[]
    encodeUrlSafe(byte[] src)
    Base64-encode the given byte array using the RFC 4648 "URL and Filename Safe Alphabet".

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • Base64Utils

      public Base64Utils()
  • 方法详细资料

    • encode

      public static byte[] encode(byte[] src)
      Base64-encode the given byte array.
      参数:
      src - the original byte array
      返回:
      the encoded byte array
    • decode

      public static byte[] decode(byte[] src)
      Base64-decode the given byte array.
      参数:
      src - the encoded byte array
      返回:
      the original byte array
    • encodeUrlSafe

      public static byte[] encodeUrlSafe(byte[] src)
      Base64-encode the given byte array using the RFC 4648 "URL and Filename Safe Alphabet".
      参数:
      src - the original byte array
      返回:
      the encoded byte array
    • decodeUrlSafe

      public static byte[] decodeUrlSafe(byte[] src)
      Base64-decode the given byte array using the RFC 4648 "URL and Filename Safe Alphabet".
      参数:
      src - the encoded byte array
      返回:
      the original byte array
    • encodeToString

      public static String encodeToString(byte[] src)
      Base64-encode the given byte array to a String.
      参数:
      src - the original byte array
      返回:
      the encoded byte array as a UTF-8 String
    • decodeFromString

      public static byte[] decodeFromString(String src)
      Base64-decode the given byte array from an UTF-8 String.
      参数:
      src - the encoded UTF-8 String
      返回:
      the original byte array
    • encodeToUrlSafeString

      public static String encodeToUrlSafeString(byte[] src)
      Base64-encode the given byte array to a String using the RFC 4648 "URL and Filename Safe Alphabet".
      参数:
      src - the original byte array
      返回:
      the encoded byte array as a UTF-8 String
    • decodeFromUrlSafeString

      public static byte[] decodeFromUrlSafeString(String src)
      Base64-decode the given byte array from an UTF-8 String using the RFC 4648 "URL and Filename Safe Alphabet".
      参数:
      src - the encoded UTF-8 String
      返回:
      the original byte array