Fork me on GitHub

用base64Encoder进行编码 和base64Decoder解码

编码:

sun.misc.BASE64Encoder base64Encoder = new sun.misc.BASE64Encoder();

String classStr = base64Encoder.encode(classBytes.toByteArray());

 

解码:

byte[] classBytes = base64Decoder.decodeBuffer(classStr);

ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(classBytes));

posted @ 2016-07-15 13:54  淡无心  阅读(13032)  评论(0编辑  收藏  举报