• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to write in file using OutputStream  RSS feed

 
barlet south
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator




Reconstruction class and its method recoverfile gives us back an array of ascii values . Let say [49,78,69,59] . Now this array content i pass to the FileToBeTaken's method fileBack . This class and its method is given below :



Now what i do not get is why my file my.txt has no content in it ? i have a byte of array and with ascii values but the content its not going to the file and so the file is still empty.
I am wondering am i doing something wrong? Can anyone explain me how to solve this?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From what I can see, this ought to work given that the array really does contain what you expect. When you run the whole program, do you see the print statements printing what you expect?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!