I am working with a DataInputStream and had a question about EOFExceptions.
According to java docs:
Signals that an end of file or end of st
The key word is unexpected.
If you use DataInputStream and read a 4 byte integer but there were only 3 bytes remaining in the stream you'll get an EOFException.
But if you call read() at the end of stream you'll just get -1 back and no exception.