I have the following code to read from .ser file.
File file = new File("/home/dhans/travelcache/test.ser");
ObjectInputStream is = new ObjectInputStream(
new BufferedInputStream(new FileInputStream(file)));
and i am reading from the input stream by
is.readObject();
my question is how to find out whether end of file is reached using
ObjectInputStream.i tried with something like the following
while(is.readObject() != null) {
// do something
}
but no use it is throwing java.io.EOFException if EOF is reached.
Is there a method/way to test whether end of file is reached.
any help would be helpful
tia,
dhanasekaran