Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #8431

Re: Creating a PrintWriter with BufferedWriter versus just File

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.mixmin.net!news2.arglkargh.de!diablo1.news.osn.de!news.osn.de!diablo2.news.osn.de!news.tele.dk!news.tele.dk!small.news.tele.dk!feed118.news.tele.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
Date Fri, 30 Sep 2011 21:30:33 -0400
From Arne Vajhøj <arne@vajhoej.dk>
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2
MIME-Version 1.0
Newsgroups comp.lang.java.programmer
Subject Re: Creating a PrintWriter with BufferedWriter versus just File
References <80d64f66-ad97-4b6e-8000-25c684ade081@p11g2000yqe.googlegroups.com>
In-Reply-To <80d64f66-ad97-4b6e-8000-25c684ade081@p11g2000yqe.googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Lines 22
Message-ID <4e866d3c$0$288$14726298@news.sunsite.dk> (permalink)
Organization SunSITE.dk - Supporting Open source
NNTP-Posting-Host 72.192.23.141
X-Trace news.sunsite.dk DXC=Ghn\WBH31;5Bi9D?DQ_c:4YSB=nbEKnk;RaZ^n=Xfmb7JPe3\kP5EU1KBm9cfh9BS4M2;kT<[:>[1<bH>46;LMI12Uf?kicYe?0
X-Complaints-To staff@sunsite.dk
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8431

Show key headers only | View raw


On 9/30/2011 1:00 PM, KevinSimonson wrote:
> What's the difference between this code:
>
> PrintWriter destination
>            = new PrintWriter
>                ( new BufferedWriter( new FileWriter( new File( arg))));
>
> and this code:
>
> PrintWriter destination = new PrintWriter( new File( arg));
>
> Do I get buffered output with the first code that I don't get with the
> second code?  Or do I get the same buffered behavior with both?

You can lookup the classes in the Java docs.

If the docs does not say that class XYZ does ABC, then
you should not rely on class XYZ doing ABC even though
a specific implementation may do it.

Arne

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Creating a PrintWriter with BufferedWriter versus just File KevinSimonson <kvnsmnsn@hotmail.com> - 2011-09-30 10:00 -0700
  Re: Creating a PrintWriter with BufferedWriter versus just File Lew <lewbloch@gmail.com> - 2011-09-30 12:55 -0700
  Re: Creating a PrintWriter with BufferedWriter versus just File Arne Vajhøj <arne@vajhoej.dk> - 2011-09-30 21:30 -0400
  Re: Creating a PrintWriter with BufferedWriter versus just File Roedy Green <see_website@mindprod.com.invalid> - 2011-10-01 05:06 -0700
    Re: Creating a PrintWriter with BufferedWriter versus just File Arne Vajhøj <arne@vajhoej.dk> - 2011-10-01 15:53 -0400

csiph-web