Does java 6 support reading from and writing to the same file at once?

dinosaur

This branches into two questions:

  1. I know it's possible to create a FileReader and a FileWriter for the same file at once. Do the FileReader and FileWriter play well with each other, i.e., is the newly written content guaranteed to be visible to the reader while both are still open? Is there any guaranteed behavior for the way that they will interact with each other?

  2. Is it possible to create one entity that can read, write, and seek within a file? For example, something equivalent to python's open(filename, "r+"). If such an entity exists, is there one in java.io or only third party?

jeremyjjbrown

You can use a RandomAccessFile

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Java reading and writing to same file

From Dev

Reading and writing Integers from/to file in Java

From Dev

Java - Reading from and Writing to a Text File

From Dev

Java writing and reading bytes to/from a file

From Dev

writing to and reading from binary file java

From Dev

Reading or Writing Excel (xlsx) file from java

From Dev

Reading and writing to the same file from two different scripts at the same time

From Dev

writing back into the same file after reading from the file

From Dev

writing back into the same file after reading from the file

From Dev

Why does reading and writing to the same file in a pipeline produce unreliable results?

From Dev

Why does reading and writing a JPEG with Java ImageIO reduce the file size?

From Dev

Reading and writing bytes from/to a file

From Dev

Reading and writing variables from file

From Dev

Writing/reading objects from a file

From Dev

Android - Reading and writing from file

From Dev

Reading and writing a file in java in hexadecimal?

From Dev

Writing a Long from Java in a file and reading it in C++

From Dev

Problem in reading input from user and writing to a file in Java

From Dev

Reading from one java file and writing to another one

From Dev

Is reading and writing to the same file thread-safe?

From Dev

Reading and writing to the same file using fstream

From Dev

Perl performance when reading and writing the same file

From Dev

Problems reading and writing to the same file descriptor in Linux

From Dev

Index not the same between writing and reading excel file

From Dev

Python StreamIO reading and writing from the same stream

From Dev

Why is dd reading from and writing to the same disk?

From Dev

Reading and Writing From Same Socket in Flink / Kafka

From Dev

Reading from a file and writing it back to a file in java(Having trouble understanding BufferedWriter write method in java)

From Dev

'IndexError: list index out of range' - reading & writing from same csv file

Related Related

  1. 1

    Java reading and writing to same file

  2. 2

    Reading and writing Integers from/to file in Java

  3. 3

    Java - Reading from and Writing to a Text File

  4. 4

    Java writing and reading bytes to/from a file

  5. 5

    writing to and reading from binary file java

  6. 6

    Reading or Writing Excel (xlsx) file from java

  7. 7

    Reading and writing to the same file from two different scripts at the same time

  8. 8

    writing back into the same file after reading from the file

  9. 9

    writing back into the same file after reading from the file

  10. 10

    Why does reading and writing to the same file in a pipeline produce unreliable results?

  11. 11

    Why does reading and writing a JPEG with Java ImageIO reduce the file size?

  12. 12

    Reading and writing bytes from/to a file

  13. 13

    Reading and writing variables from file

  14. 14

    Writing/reading objects from a file

  15. 15

    Android - Reading and writing from file

  16. 16

    Reading and writing a file in java in hexadecimal?

  17. 17

    Writing a Long from Java in a file and reading it in C++

  18. 18

    Problem in reading input from user and writing to a file in Java

  19. 19

    Reading from one java file and writing to another one

  20. 20

    Is reading and writing to the same file thread-safe?

  21. 21

    Reading and writing to the same file using fstream

  22. 22

    Perl performance when reading and writing the same file

  23. 23

    Problems reading and writing to the same file descriptor in Linux

  24. 24

    Index not the same between writing and reading excel file

  25. 25

    Python StreamIO reading and writing from the same stream

  26. 26

    Why is dd reading from and writing to the same disk?

  27. 27

    Reading and Writing From Same Socket in Flink / Kafka

  28. 28

    Reading from a file and writing it back to a file in java(Having trouble understanding BufferedWriter write method in java)

  29. 29

    'IndexError: list index out of range' - reading & writing from same csv file

HotTag

Archive