File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unexpected Behaviour with Writers

 
jean-gobert de coster
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm running he following code:



And when I run it, the output is the following:

Hello!I'm a FileWriter
I'm a BufferedWriter
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is that unexpected behavior? The buffered writer buffers its output, while the straight writer writes immediately. Seems like it should be.

As an aside, I wouldn't use several writers that access the same underlying resource.
 
jean-gobert de coster
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah ok... Buffered... figures :-) By Unexpected, I meant "that I didn't expect" of course. Thanks for the answer
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic