Return-Path: Delivered-To: apmail-jakarta-lucene-dev-archive@www.apache.org Received: (qmail 18833 invoked from network); 21 Sep 2003 05:51:30 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 21 Sep 2003 05:51:30 -0000 Received: (qmail 40998 invoked by uid 500); 21 Sep 2003 05:51:05 -0000 Delivered-To: apmail-jakarta-lucene-dev-archive@jakarta.apache.org Received: (qmail 40977 invoked by uid 500); 21 Sep 2003 05:51:05 -0000 Mailing-List: contact lucene-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Developers List" Reply-To: "Lucene Developers List" Delivered-To: mailing list lucene-dev@jakarta.apache.org Received: (qmail 40964 invoked from network); 21 Sep 2003 05:51:05 -0000 Received: from unknown (HELO host-65-125-35-13.larp.gov) (65.125.35.13) by daedalus.apache.org with SMTP; 21 Sep 2003 05:51:05 -0000 Received: from earthlink.net ([65.174.70.194]) by host-65-125-35-13.larp.gov (8.11.6/8.11.6) with ESMTP id h8L4rsn32673 for ; Sat, 20 Sep 2003 22:53:54 -0600 Message-ID: <3F6D3D9B.3020509@earthlink.net> Date: Sat, 20 Sep 2003 23:56:43 -0600 From: Dmitry Serebrennikov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Lucene Developers List Subject: Re: FSInputStream strangeness References: <3F6CC0F5.10200@earthlink.net> In-Reply-To: <3F6CC0F5.10200@earthlink.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Here's a quick program to demonstrate what I mean: private void demo_FSInputStreamBug(FSDirectory fsdir, String file) throws IOException { // Setup the test file - we need more than 1024 bytes OutputStream os = fsdir.createFile(file); for(int i=0; i<2000; i++) { os.writeByte((byte) i); } os.close(); InputStream in = fsdir.openFile(file); // This read primes the buffer in InputStream byte b = in.readByte(); // Close the file in.close(); // ERROR: this call should fail, but succeeds because the buffer // is still filled b = in.readByte(); // ERROR: this call should fail, but succeeds for some reason as well in.seek(1099); try { // OK: this call correctly fails. We are now past the 1024 internal // buffer, so an actual IO is attempted, which fails b = in.readByte(); } catch (IOException e) { } } --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-dev-help@jakarta.apache.org