public class Base64Util extends Object
| Modifier and Type | Field and Description |
|---|---|
static Base64.Decoder |
DECODER |
static Base64.Encoder |
ENCODER |
static Base64.Decoder |
URL_DECODER |
static Base64.Encoder |
URL_ENCODER |
| Constructor and Description |
|---|
Base64Util() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decode(byte[] src)
Base64-decode the given byte array.
|
static String |
decode(String value)
解码
|
static String |
decode(String value,
Charset charset)
解码
|
static byte[] |
decodeFromString(String src)
Base64-decode the given byte array from an UTF-8 String.
|
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".
|
static byte[] |
decodeUrlSafe(byte[] src)
Base64-decode the given byte array using the RFC 4648
"URL and Filename Safe Alphabet".
|
static String |
decodeUrlSafe(String value)
解码URL安全
|
static String |
decodeUrlSafe(String value,
Charset charset)
解码URL安全
|
static byte[] |
encode(byte[] src)
Base64-encode the given byte array.
|
static String |
encode(String value)
编码
|
static String |
encode(String value,
Charset charset)
编码
|
static String |
encodeToString(byte[] src)
Base64-encode the given byte array to a String.
|
static String |
encodeToUrlSafeString(byte[] src)
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".
|
static String |
encodeUrlSafe(String value)
编码URL安全
|
static String |
encodeUrlSafe(String value,
Charset charset)
编码URL安全
|
public static final Base64.Encoder ENCODER
public static final Base64.Encoder URL_ENCODER
public static final Base64.Decoder DECODER
public static final Base64.Decoder URL_DECODER
public static String encode(String value, Charset charset)
value - 字符串charset - 字符集public static String encodeUrlSafe(String value)
value - 字符串public static String encodeUrlSafe(String value, Charset charset)
value - 字符串charset - 字符集public static String decode(String value, Charset charset)
value - 字符串charset - 字符集public static String decodeUrlSafe(String value)
value - 字符串public static String decodeUrlSafe(String value, Charset charset)
value - 字符串charset - 字符集public static byte[] encode(byte[] src)
src - the original byte arraypublic static byte[] decode(byte[] src)
src - the encoded byte arraypublic static byte[] encodeUrlSafe(byte[] src)
src - the original byte arraypublic static byte[] decodeUrlSafe(byte[] src)
src - the encoded byte arraypublic static String encodeToString(byte[] src)
src - the original byte arraypublic static byte[] decodeFromString(String src)
src - the encoded UTF-8 Stringpublic static String encodeToUrlSafeString(byte[] src)
src - the original byte arraypublic static byte[] decodeFromUrlSafeString(String src)
src - the encoded UTF-8 StringCopyright © 2024. All rights reserved.