java - Method similar to Scanner.hasNext for ObjectInputStream -
i reading .dat file unknown amount of objects within it. want loop through file using .readobject()
method. there way can determine amount of times read file similar way .hasnext()
method works scanner?
for example, use while loop hasnext()
parameter.
while (scfile.hasnext()){ x = scfile.nextint(); }
thanks in advance.
just read stream until eofexception thrown. method looking not exist.
Comments
Post a Comment