Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1F1039B6F for ; Sun, 25 Sep 2011 17:55:27 +0000 (UTC) Received: (qmail 1085 invoked by uid 500); 25 Sep 2011 17:55:25 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 962 invoked by uid 500); 25 Sep 2011 17:55:25 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 953 invoked by uid 99); 25 Sep 2011 17:55:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Sep 2011 17:55:25 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gcjcu-commons-user@m.gmane.org designates 80.91.229.12 as permitted sender) Received: from [80.91.229.12] (HELO lo.gmane.org) (80.91.229.12) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Sep 2011 17:55:16 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1R7sul-0003gN-BV for user@commons.apache.org; Sun, 25 Sep 2011 19:54:55 +0200 Received: from hsi-kbw-046-005-049-185.hsi8.kabel-badenwuerttemberg.de ([46.5.49.185]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 25 Sep 2011 19:54:55 +0200 Received: from joerg.schaible by hsi-kbw-046-005-049-185.hsi8.kabel-badenwuerttemberg.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 25 Sep 2011 19:54:55 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: user@commons.apache.org To: user@commons.apache.org From: =?UTF-8?B?SsO2cmc=?= Schaible Subject: Re: [io] Should "FileUtils.writeByteArrayToFile(...)" not use a BufferedOutputStream? Followup-To: gmane.comp.jakarta.commons.user Date: Sun, 25 Sep 2011 19:54:40 +0200 Lines: 43 Message-ID: References: <315452501.20110920232739@the-cr.de> <1962583320.20110925184553@the-cr.de> Reply-To: joerg.schaible@gmx.de Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: hsi-kbw-046-005-049-185.hsi8.kabel-badenwuerttemberg.de Mail-Copies-To: nobody User-Agent: KNode/4.4.11 X-Virus-Checked: Checked by ClamAV on apache.org Hi Timo, Timo Rumland wrote: > Hello everyone, > > sorry to bump this, but does anyone not have a comment to my question? > I really think I missed something, I can't imagine that the Commons IO > "forgot" to buffer the bytes that should be written to a file. > > Please see my original question below. Why should it? You provide all the bytes which are written immediately and the stream is closed afterwards. So what should a buffer be good for except for decreasing performance? - Jörg > > Thanks a lot! > > ------------------------------------- > >> Hello, > >> I recently started using the FileUtils class of Commons IO, and had a >> quick look into the source code. > >> The method "FileUtils.writeByteArrayToFile(...)" internally uses the >> private method "openOutputStream(...)", which creates (after some >> smart checks) an FileOutputStream. > >> But, shouldn't "writeByteArrayToFile(...)" or "openOutputStream(...)" >> not use/create a BufferedOutputStream, wrapping the FileOutputStream? > >> Or do I overlook something? > >> I think one should always buffer the bytes when writing to a file... > >> Any thoughts? > >> Thanks ! --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org