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 :
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.
Yes you are right, i was reading the ObjectInputStream$BlockDataInputStream.readBlockHeader implementation when i realized that it uses read() to get a byte. The fact read() returns an integer made me implement it to read 4 bytes... I should have read more thorougly the javadoc of InputStream.
Thanks for your help !