Use the return of readBytes to find out if we are at the end of the stream.