writing inside a file(before the end of the file)

how can i write in the middle or the beginning of a file?
i used FileInputStream and DataInputStream to read from the file and i used seek and reset to reach other places of the file, but there no such functions in FileOutputStream or inDataOutputStream so i can write only at the end of the file as a figured out.

what can i do?

dolev

Comments

  • : how can i write in the middle or the beginning of a file?
    : i used FileInputStream and DataInputStream to read from the file and i used seek and reset to reach other places of the file, but there no such functions in FileOutputStream or inDataOutputStream so i can write only at the end of the file as a figured out.
    :
    : what can i do?
    :
    : dolev
    :


    FileWriter has a constructor that takes a boolean value to append. False overwrites, true appends. Wrap FileWriter in a PrintWriter object.
    [italic][blue]Just my 2 bits[/blue][/italic]

  • thanks you for the help

    dolev
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories