【发布时间】:2010-01-19 11:32:29
【问题描述】:
我正在用 Java 编写客户端和服务器,客户端发送请求以创建证书。此请求包含许多不同的数据类型,包括字节 [],我现在这样做的方式是使用 ObjectStreams,例如:
objectStream.writeObject( new String("value of field1"));
objectStream.flush();
objectStream.writeObject( new String("value of field"));
objectStream.flush();
objectStream.writeObject( publicKey);
objectStream.flush();
...
现在我知道这是一个非常糟糕的设计,但我不太确定如何改进它。
XML 会是个好主意吗?
谢谢,
【问题讨论】: