getContents package:streaming-bytestring

Equivalent to hGetContents stdin. Will read lazily.
Read entire handle contents lazily into a ByteStream. Chunks are read on demand, using the default chunk size. Note: the Handle should be placed in binary mode with hSetBinaryMode for hGetContents to work correctly.
Read entire handle contents lazily into a ByteStream. Chunks are read on demand, in at most k-sized chunks. It does not block waiting for a whole k-sized chunk, so if less than k bytes are available then they will be returned immediately as a smaller chunk. Note: the Handle should be placed in binary mode with hSetBinaryMode for hGetContentsN to work correctly.