Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

what is the difference connecting files in differeceways , what is advantage ,how to remember  RSS feed

 
raj talatam
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is difference between conncting Strems like this

FileOutputStream fos=new FileOutputStream(new File("xyza.graphml"));
DataOutputStream dos=new DataOutputStream(fos);
BufferedWriter br=new BufferedWriter(new OutputStreamWriter(dos));

and
FileOutputStream fos=new FileOutputStream(new File("xyza.graphml"));
BufferedOutputStream bos=new BufferedOutputStream(fos);

 
Joe Ess
Bartender
Posts: 9429
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read the Java API Documentation? It's all in there.
For your example, DataOutputStream and DataInputStream are used for reading and writing Java primitive types, which is handy if you have a set file format that will be processed by Java applications.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!