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