A jpg file is a binary file, but if it wasn't you could use a
StringBuilder[
^]
Using String as a buffer for the input is inefficient, string really isn't meant for this.
You should determine the size of the file in bytes and use a
byte[]
array with the
read[
^] method.
Best regards
Espen Harlinn