0
我試圖反序列化對象,其中:從標準JVM傳遞序列化的外部化對象CodenameOne
- 創建並連載於另一個標準JVM(服務器)
- 實現傳統的Java Externalizable接口
- 通過了在網絡
public static void getData() { ConnectionRequest req = new ConnectionRequest() { @Override protected void readResponse(InputStream is) throws IOException { DataInputStream dis = new DataInputStream(is); Employee recovered = new Employee(); recovered.internalize(1, dis); } }; req.setUrl(BASEURL); req.setPost(false); NetworkManager.getInstance().addToQueueAndWait(req); }
從遠程jvm我傳遞ByteArray或ByteArrayInputStream對象,並在CN1我得到EOFException。
這樣可以傳遞對象嗎?或者我應該使用JSON。
我以爲我不需要JSON,如果我雙方都有Java。