• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem writing to FileInputStream  RSS feed

 
Ronnie Phelps
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried writing to a specified position in a file once and the write was succesful. If I continue to write to the same position the writes are successful. But when I try writing to another position, somehow I get a bunch of garbage added to the start of my file. There may be an obvious reason for this, but because I don't have much I/0 experience, I don't have a clue why this would be happening. Any suggestions will be appreciated.
 
Sun LiWei
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please paste your source code.I can't understand.
 
Steve Deadsea
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Writing *to* a FileInputStream is not possible. I would expect one to write to a FileOutputStream.
 
Ronnie Phelps
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The subject had a typo. I meant to put Output stream. I decided to user RandomAccessFile and my problem went away.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!