Fix some output streams writing too many bytes
There is a bug in the FileUtil.copy method where the output stream writes too much data, causing the copied file not to be the same as the original file. This fix ensures that the output stream writes only the number of bytes read from the input stream.
Potentially the same in Encryption encrypt (only 8 bytes, probably OK) and ManageWorkoutsActivity (saveImport not common)
Yes, definitely the same in ManageWorkoutsActivity. Should I edit this PR and make it more general to include a fix for ManageWorkoutsActivity as well, or make a new PR?
Potentially the same in Encryption encrypt (only 8 bytes, probably OK) and ManageWorkoutsActivity (saveImport not common)
Yes, definitely the same in ManageWorkoutsActivity. Should I edit this PR and make it more general to include a fix for ManageWorkoutsActivity as well, or make a new PR?
You can add to this PR. Those extra occurrences are not occurring often, but it is nice to handle them at the same time. (saveImport at least) I have not checked where this PR change is actually used.
You can add to this PR.
OK, will do.
I have not checked where this PR change is actually used.
FileUtil.copy is used from MainLayout.handleBundled to import workouts/schemes from the assets folder.