137
137
* take up a lot of CPU cycles.
138
138
* @param buf ByteBuffer - the buffer containing the data, we will read as until we have read at least one byte or we timed out
139
139
* @param socket SocketChannel - the socket to write data to
141
140
* @param readTimeout long - the timeout for this read operation in milliseconds, -1 means no timeout
142
141
* @return int - returns the number of bytes read
143
142
* @throws EOFException if read returns -1