The most likely situation is that there is a problem with the Size() method and the calculation is incorrect. It is also possible that the BUG is caused by using multi-threaded output to mergingFile and requires specific debugging.
You can first test a lot. After the execution is completed, compare the number of bytes output by mergingFile with the sum of the number of input bytes of smallFile and originalFile to see if they are equal. If they are equal, it is a problem with Size(). If they are not equal, check whether there are any bytes lost or overwritten in the output stream of mergingFile.
1) You said that two image files can be directly merged into one file in this way and the format must be correct? 2) Does the generated file have a compression algorithm in it, such as jpeg, jpg
The most likely situation is that there is a problem with the Size() method and the calculation is incorrect. It is also possible that the BUG is caused by using multi-threaded output to mergingFile and requires specific debugging.
You can first test a lot. After the execution is completed, compare the number of bytes output by mergingFile with the sum of the number of input bytes of smallFile and originalFile to see if they are equal. If they are equal, it is a problem with Size(). If they are not equal, check whether there are any bytes lost or overwritten in the output stream of mergingFile.
1) You said that two image files can be directly merged into one file in this way and the format must be correct?
2) Does the generated file have a compression algorithm in it, such as jpeg, jpg