• Post Reply Bookmark Topic Watch Topic
  • New Topic

Printwriter not writing complete data

 
satishkumar janakiraman
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have written a file using printwriter and filewriter. But I found a strange problem when I open the file. Can anyone tell me what exactly went wrong in the following code snippet? I tried using flush also but it does not work.



problem:
I see only half of the response in the file


sat
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by satishkumar janakiraman:
I tried using flush also but it does not work.


Really? The same code works fine for me after adding a call to flush().
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or better, call close(). After you're done with any stream, close it!
 
satishkumar janakiraman
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ernest,

Thanks for your reply. It works.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!