断点调试时查看一个对象序列化后的字节大小 Leave a Comment / Java / February 16, 2012 February 16, 2012 仅供拷贝,无干货 java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream(); java.io.ObjectOutputStream out = new java.io.ObjectOutputStream(bos); out.writeObject(theObject); System.out.println(bos.toByteArray().length); out.close();