ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(reg_be);
oos.flush();
oos.close();
InputStream is = new ByteArrayInputStream(baos.toByteArray());
Mã này chuyển đổi Java Object
-InputStream
và làm thế nào tôi có thể chuyển đổi InputStream
một Object
? Tôi cần phải chuyển đổi Object
thành InputStream
sau đó tôi chuyển nó và tôi muốn lấy lại số Object
của mình.làm thế nào để chuyển đổi một input stream đến một đối tượng java
ObjectInputStream dường như thực sự rõ ràng. – Gimby