Don’t Use FileInputStream to Transfer Files

lance
Level Up Coding
Published in
4 min readOct 20, 2022

--

For efficiency, use FileChannel.

Everyone is familiar with the copying of files. I assume everyone uses input and output streams to operate as I do. Create an input stream from the source file, then create an output stream from the target file, and finally read the data of the input stream into the output stream.

--

--