开发者

ObjectInputStream read Array

I am trying to read in an array from ObjectInputStream in Java. I can find no documentation on how to do this. I assume that it开发者_开发百科 is readObject(), but this doesn't seem to work.

out.write(Object)
out.write(Object)
out.write(boolean[])

... in servlet ...

Object one = in.readObject();
Object two = in.readObject();
boolean[] thr = (boolean[])in.readObject();

Is this correct or am I doing it wrong? If it's correct then any ideas on why it might not like this?


Your reading code is correct. Your writing pseudo-code is also correct, assuming that it really is pseudo-code and that you are actually calling those methods with arguments of those types in that order.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜