Just close the FSDataOutputStream stream. This is for writing a single file. FileSystem is just a client as you understand it, and it is completely different from closing the read-write stream of a single file. In addition, the main purpose of closing the FSDataOutputStream stream is to flush the currently written content to the real file system, otherwise the reading and writing may be out of sync and cause problems
Yes
Just close the FSDataOutputStream stream. This is for writing a single file. FileSystem is just a client as you understand it, and it is completely different from closing the read-write stream of a single file. In addition, the main purpose of closing the FSDataOutputStream stream is to flush the currently written content to the real file system, otherwise the reading and writing may be out of sync and cause problems