Cannot see the contents of the array printed in console [duplicate]
问题 This question already has answers here : What's the simplest way to print a Java array? (33 answers) Closed last year . public RMI post(PrintStream stream, Object object) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); // oos.writeObject(System.rmi); oos.flush(); oos.close(); // stream.println("Class size: " + baos.toByteArray().length); stream.println("Class data: " + baos.toByteArray()); stream.flush(); stream.close();