Return-Path: Delivered-To: apmail-jakarta-poi-dev-archive@apache.org Received: (qmail 60184 invoked from network); 1 Aug 2003 13:34:08 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 1 Aug 2003 13:34:08 -0000 Received: (qmail 8651 invoked by uid 97); 1 Aug 2003 13:36:41 -0000 Delivered-To: qmlist-jakarta-archive-poi-dev@nagoya.betaversion.org Received: (qmail 8644 invoked from network); 1 Aug 2003 13:36:40 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 1 Aug 2003 13:36:40 -0000 Received: (qmail 55792 invoked by uid 500); 1 Aug 2003 13:33:10 -0000 Mailing-List: contact poi-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "POI Developers List" Reply-To: "POI Developers List" Delivered-To: mailing list poi-dev@jakarta.apache.org Received: (qmail 55732 invoked from network); 1 Aug 2003 13:33:09 -0000 Received: from unknown (HELO set.superlinksoftware.com) (66.35.175.110) by daedalus.apache.org with SMTP; 1 Aug 2003 13:33:09 -0000 Received: from rdu57-249-152.nc.rr.com ([66.57.249.152]) by set.superlinksoftware.com (JAMES SMTP Server 2.1) with SMTP ID 401 for ; Fri, 1 Aug 2003 07:51:57 -0400 (EDT) User-Agent: Microsoft-Entourage/10.1.0.2006 Date: Fri, 01 Aug 2003 09:33:10 -0400 Subject: Re: cvs commit: jakarta-poi/src/testcases/org/apache/poi/poifs/filesystem SlowInputStream.java TestDocument.java From: "Andrew C. Oliver" To: POI Developers List Message-ID: In-Reply-To: <16636.1059735498@www58.gmx.net> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Status: X-Status: X-Keywords: On 8/1/03 6:58 AM, "rainer.klute@gmx.de" wrote: >> 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 That and it needs a timeout as well. -- Andrew C. Oliver http://www.superlinksoftware.com/poi.jsp Custom enhancements and Commercial Implementation for Jakarta POI http://jakarta.apache.org/poi For Java and Excel, Got POI? --------------------------------------------------------------------- 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/