ByteArrayOutputStream os = new ByteArrayOutputStream();
Hessian2Output ho = new Hessian2Output(os);
ho.writeObject(m);
ho.getBytesOutputStream().flush();
ho.completeMessage();
ho.close();
byte[] bs = os.toByteArray();
System.out.println(bs.length);
网友评论