qint64 QIODevice::read ( char * data, qint64 maxSize )

Reads at most maxSize bytes from the device into data, and returns the number of bytes read.
 If an error occurs, such as when attempting to read from a device opened in WriteOnly mode, this function returns -1.

0 is returned when no more data is available for reading.
 However, reading past the end of the stream is considered an error, so this function returns -1 in those cases
 (that is, reading on a closed socket or after a process has died).

See also readData(), readLine(), and write().