Yes, this is behaving as documented:
Creates an ObjectInputStream that reads from the specified InputStream. A serialization stream header is read from the stream and verified.
...
Throws:
IOException - if an I/O error occurs while reading stream header
If your file is empty, it doesn't contain the stream header. A file which has been created using an ObjectOutputStream
which has been closed after writing 0 objects is not the same thing as an empty file.