java StreamCorruptedException: invalid type code: 77040000, what the ObjectInputStream expects?

前端 未结 2 1734
野性不改
野性不改 2021-01-29 02:15

i\'m working on a network java code, and i can\'t seem to understand what are the prerequisites an ObjectInputStream needs to interpret bytes. Here is a part of the code :

2条回答
  •  -上瘾入骨i
    2021-01-29 02:28

    Your read() method is broken. It is supposed to return a single byte. You should read the javadoc for InputStream thoroughly if you intend to write your own implementation.

提交回复
热议问题