Use BufferedWriter to write the same data to multiple files

I am interested in writing some data that I get in two different files (same data).

In my code, I use BufferedWriterit FileWriterto write data to files, and I want to write the same data as a backup in local storage and on an SD card.

My question is: if I need to implement this with 2 FileWritersand 2 BufferedWriters, or is there a way to use the same BufferedWriterfor both files?

Is there a more efficient way to accomplish this?

+4
source share
1 answer

- Writer, . ( CopyingWriter ctor BufferedWriter).

. . .

. , n . . , n . "" - , (. ).

+5

Source: https://habr.com/ru/post/1694130/


All Articles