poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rainer.kl...@gmx.de
Subject Re: cvs commit: jakarta-poi/src/testcases/org/apache/poi/poifs/filesystem SlowInputStream.java TestDocument.java
Date Fri, 01 Aug 2003 10:58:18 GMT
>   Slow input stream patch, bug 13478
> ...
>           for (;;) {
>               int got = in.read(b, off + total, len - total);
>               if (got < 0) {
>                   return (total == 0) ? -1 : total;
>               } else {
>                   total += got;
>                   if (total == len)
>                       return total;
>               }
>           }

Hi Avik,

thanks for the patch! I suggest that the loop waits for a moment when read()
received less bytes than expected. Otherwise it would be a waste of CPU
cycles on very slow streams.

Best regards
Rainer Klute

-- 
                  RAINER KLUTE IT-CONSULTING GMBH
Dipl.-Inform.
Rainer Klute      klute@rainer-klute.de
Körner Grund 24   Telefon: +49 172 2324824
D-44143 Dortmund  Telefax: +49 231 5349423

COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
--------------------------------------------------
1. GMX TopMail - Platz 1 und Testsieger!
2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8. e-Post


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


Mime
View raw message