用OutputStream后用ObjectOutputStream
OutputStream.write("abc\n").getBytes("GBK");然后用ObjectOutputStream在输出对象,是没问题的但是如果"abc\...
OutputStream.write("abc\n").getBytes("GBK");
然后用ObjectOutputStream在输出对象,是没问题的
但是如果"abc\n"把换行符\n去掉,就会出现
java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)
at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
求解释 展开
然后用ObjectOutputStream在输出对象,是没问题的
但是如果"abc\n"把换行符\n去掉,就会出现
java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)
at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
求解释 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询