Hi Richard,
I do not understand why you are using a while loop.
You should be able to read the required number of bytes with a call to one method in whatever class you are using to read from the file.
Even if you did want a loop to read the bytes from disk, you should only need to do one conversion from the array of bytes into the format you are returning.
You should be able to convert directly from an array of bytes into a
String without going through a StringBuffer.
Regards, Andrew