範例
public
static
String
encode64(
byte
[] bytes) {
return
encoder.encode(bytes);
}
private
static
BASE64Encoder
encoder =
new
BASE64Encoder();
public
static
void
main(
String
[] args){
System.out.println(encode64(
SunApi
.class.getName().getBytes()));
}
解決方案
如需替代方法,請參閱 Java API。