50,527
社区成员
发帖
与我相关
我的任务
分享
public static String encode(byte[] bytes) {
ByteArrayOutputStream out = new ByteArrayOutputStream((int) (bytes.length * 1.37));
Base64Encoder encodedOut = new Base64Encoder(out);
try {
encodedOut.write(bytes);
encodedOut.close();
return out.toString("8859_1");
} catch (IOException ignored) {
return null;
}
}