类 Base64
java.lang.Object
com.github.megatronking.stringfog.Base64
-
字段概要
字段修饰符和类型字段说明static final intDefault values for encoder/decoder flags.static final intEncoder flag bit to omit the padding '=' characters at the end of the output (if any).static final intEncoder flag bit to omit all line terminators (i.e., the output will be on one long line). -
方法概要
修饰符和类型方法说明static byte[]decode(byte[] input, int flags) Decode the Base64-encoded data in input and return the data in a new byte array.static byte[]Decode the Base64-encoded data in input and return the data in a new byte array.static byte[]encode(byte[] input, int flags) Base64-encode the given data and return a newly allocated byte[] with the result.static byte[]Base64-encode the given data and return a newly allocated byte[] with the result.
-
字段详细资料
-
DEFAULT
public static final int DEFAULTDefault values for encoder/decoder flags.- 另请参阅:
-
NO_PADDING
public static final int NO_PADDINGEncoder flag bit to omit the padding '=' characters at the end of the output (if any).- 另请参阅:
-
NO_WRAP
public static final int NO_WRAPEncoder flag bit to omit all line terminators (i.e., the output will be on one long line).- 另请参阅:
-
-
方法详细资料
-
decode
Decode the Base64-encoded data in input and return the data in a new byte array.The padding '=' characters at the end are considered optional, but if any are present, there must be the correct number of them.
- 参数:
str- the input String to decode, which is converted to bytes using the default charsetflags- controls certain features of the decoded output. PassDEFAULTto decode standard Base64.- 抛出:
IllegalArgumentException- if the input contains incorrect padding
-
decode
public static byte[] decode(byte[] input, int flags) Decode the Base64-encoded data in input and return the data in a new byte array.The padding '=' characters at the end are considered optional, but if any are present, there must be the correct number of them.
- 参数:
input- the input array to decodeflags- controls certain features of the decoded output. PassDEFAULTto decode standard Base64.- 抛出:
IllegalArgumentException- if the input contains incorrect padding
-
encode
Base64-encode the given data and return a newly allocated byte[] with the result.- 参数:
str- the string to encodeflags- controls certain features of the encoded output. PassingDEFAULTresults in output that adheres to RFC 2045.
-
encode
public static byte[] encode(byte[] input, int flags) Base64-encode the given data and return a newly allocated byte[] with the result.- 参数:
input- the data to encodeflags- controls certain features of the encoded output. PassingDEFAULTresults in output that adheres to RFC 2045.
-