In int BufferedInputStream::read (void* destBuffer, int maxBytesToRead)
{
there are the following few lines:
auto oldLastReadPos = lastReadPos;
if (! ensureBuffered()
|| oldLastReadPos == lastReadPos
|| isExhausted())
break;
oldLastReadPos will always equal lastReadPos so this will always execute the break.