How do you handle the End-Of-File (EOF) condition when reading serialized objects from a file in Java?
Using a for loop until no more data is available
for
By using the available() method of InputStream
available()
InputStream
By checking if the file pointer is null
By catching the EOFException
EOFException