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

Popular posts from this blog

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -