This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

FileOutputStream constructor  RSS feed

 
Kishan Kumar
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI All,
While going through the Filewriter constructors I got this doubt,
version of constructors available
FileOutputStream(String filename, boolean append)
FileOutputStream(File f)
My doubt is why there is no overloaded constructor having the
following signature,
FileOutputStream(File f, boolean append)
Is there any specific reason this version of constructor not
included in the API.

------------------
Regards,
V. Kishan Kumar
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's an annoying gap, isn't it - however it is easy to do:
(where f is a File object)
new FileOutputStream( f.getAbsolutePath(), flag );
Bill
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am moving this thread to I/O and Streams.
Ajith
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!