hGet package:storablevector
Read a
Vector directly from the specified
Handle. This
is far more efficient than reading the characters into a list and then
using
pack.
Read the rest of a file lazily and provide the reason of termination
as IOError. If IOError is EOF (check with System.Error.isEOFError
err), then the file was read successfully. Only access the final
IOError after you have consumed the file contents, since finding out
the terminating reason forces to read the entire file. Make also sure
you read the file completely, because it is only closed when the file
end is reached (or an exception is encountered).
TODO: In ByteString.Lazy the chunk size is reduced if data is not
immediately available. Maybe we should adapt that behaviour but when
working with realtime streams that may mean that the chunks are very
small.