Attempts to fill the given buffer by reading data.
For potentially blocking data sources (e.g. sockets), read() will only
block if no data is available at all. If there is some data available,
but waiting for new data to arrive would be required to fill the whole
buffer, the readily available data will be immediately returned – use
readAll() if you want to wait until the whole buffer is filled.
Attempts to fill the given buffer by reading data.
For potentially blocking data sources (e.g. sockets), read() will only block if no data is available at all. If there is some data available, but waiting for new data to arrive would be required to fill the whole buffer, the readily available data will be immediately returned – use readAll() if you want to wait until the whole buffer is filled.