hGetBufSome hdl buf count reads data from the handle
hdl into the buffer
buf. If there is any data
available to read, then
hGetBufSome returns it immediately; it
only blocks if there is no data to be read.
It returns the number of bytes actually read. This may be zero if EOF
was reached before any data was read (or if
count is zero).
hGetBufSome never raises an EOF exception, instead it returns a
value smaller than
count.
If the handle is a pipe or socket, and the writing end is closed,
hGetBufSome will behave as if EOF was reached.
hGetBufSome ignores the prevailing
TextEncoding and
NewlineMode on the
Handle, and reads bytes directly.