用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));