I'm still checking through so I can't say for sure,
but it looks certain enough that Ronald was correct,
although Peter's comment about using too many while
loops also improved performance.
I'm afraid I largely taught myself Java, coming from
a C / C++ background and misunderstood the method summary
for read().
Thanks for the help, and I'll take Yoav's tip on board too.
Adam.
On Wed, 2004-03-10 at 14:14, Shapira, Yoav wrote:
> Hi,
>
> >Why not simply use:
> >
> > String line = null;
> > while ((line = bfFile.readLine()) != null) {
> > LoginLog logEntry = getLogEntry(line); // Create log entry from
> the
> >line just read.
> > log.add(logEntry);
> > }
> >
> >There is no need to use 'bfFile.ready()'. This method only checks
> >whether the call to a read method may block, which is not a problem
> >at all.
>
> I couldn't have said it any better -- good advice ;)
>
> One thing you could have done (or still can do if you haven't changed
> the code by now) is observe your program with a profiler, or even step
> through it with a debugger, to see it never getting out if the
> while(ready) loop.
>
> Yoav Shapira
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]