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


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

Re: Diff. between FileWriter("f.txt") and OutputStreamWriter(new FileOutputStream("f.txt")) ?

From Roedy Green <see_website@mindprod.com.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Diff. between FileWriter("f.txt") and OutputStreamWriter(new FileOutputStream("f.txt")) ?
Date 2011-08-31 14:13 -0700
Organization Canadian Mind Products
Message-ID <nu8t579m0u86h0ptum2d4cdutmc2v4nar2@4ax.com> (permalink)
References <4e57267d$0$6552$9b4e6d93@newsspool4.arcor-online.net>

Show all headers | View raw


On 26 Aug 2011 04:52:14 GMT, jochen2@brenz.com (Jochen Brenzlinger)
wrote, quoted or indirectly quoted someone who said :

>As you know there are two ways of writing text into a text file:
>
>1.) BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("MyFile.txt")));
>    out.write(s);
>
>and
>
>2.) BufferedWriter out = new BufferedWriter(new FileWriter("MyFile.txt"));
>    out.write(s);
>
>Whats the difference?

Trace.  Likely you will find there is no real difference, just a
matter of which convenience methods are used to glue the Lego blocks
together.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
The modern conservative is engaged in one of man's oldest exercises in moral philosophy; that is, 
the search for a superior moral justification for selfishness.
~ John Kenneth Galbraith (born: 1908-10-15 died: 2006-04-29 at age: 97) 

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


Thread

Diff. between FileWriter("f.txt") and OutputStreamWriter(new FileOutputStream("f.txt")) ? jochen2@brenz.com (Jochen Brenzlinger) - 2011-08-26 04:52 +0000
  Re: Diff. between FileWriter("f.txt") and OutputStreamWriter(new FileOutputStream("f.txt")) ? Silvio <silvio@moc.com> - 2011-08-26 09:22 +0200
  Re: Diff. between FileWriter("f.txt") and OutputStreamWriter(new FileOutputStream("f.txt")) ? Lew <lewbloch@gmail.com> - 2011-08-26 00:54 -0700
  Re: Diff. between FileWriter("f.txt") and OutputStreamWriter(new FileOutputStream("f.txt")) ? Roedy Green <see_website@mindprod.com.invalid> - 2011-08-31 14:13 -0700
  Re: Diff. between FileWriter("f.txt") and OutputStreamWriter(new FileOutputStream("f.txt")) ? Arne Vajhøj <arne@vajhoej.dk> - 2011-09-05 21:17 -0400
  Re: Diff. between FileWriter("f.txt") and OutputStreamWriter(new FileOutputStream("f.txt")) ? Mayeul <mayeul.marguet@free.fr> - 2011-09-06 11:34 +0200
  Re: Diff. between FileWriter("f.txt") and OutputStreamWriter(new FileOutputStream("f.txt")) ? Roedy Green <see_website@mindprod.com.invalid> - 2011-09-06 06:53 -0700

csiph-web