I want to stop reading the file when it reaches the end of file.
My code looks like this.
public void fillUp() throws IOException {
int c = 1;
try {
while (c < this.size) {
next = rec.createObject();
next.readObject(dataSource);
if(next != null){
heap.put(next); // put the information just read
c = c + 1;
}else
break;
}
} catch (EOFException eof) {
}
heap.fixHeap(c);
}
even though I wrote break, it doesn't seem to work. What do I have to do to just stop reading and putting the information?
Thank you.
[ October 15, 2004: Message edited by: James Oh ]
[ October 15, 2004: Message edited by: James Oh ]
My code looks like this.
public void fillUp() throws IOException {
int c = 1;
try {
while (c < this.size) {
next = rec.createObject();
next.readObject(dataSource);
if(next != null){
heap.put(next); // put the information just read
c = c + 1;
}else
break;
}
} catch (EOFException eof) {
}
heap.fixHeap(c);
}
even though I wrote break, it doesn't seem to work. What do I have to do to just stop reading and putting the information?
Thank you.
[ October 15, 2004: Message edited by: James Oh ]
[ October 15, 2004: Message edited by: James Oh ]