Sure, if there is no data available, then nothing can be read.
The is like your bytesAvailable() check.

My suggestion was addressing the case when data is available.

Anyway, it might be helpful to see how you determine that you got less data than you expected.
All your snippet has so far is a log output that treats the data as an array of text characters.

Cheers,
_