Binary IO

Scott Turner p.turner at computer.org
Wed Apr 20 17:34:44 EDT 2005


On 2005 April 20 Wednesday 15:56, Iavor Diatchki wrote:
> I've been playing around with decoding binary files, and I couldn't
> find a function in the libraries to read a byte from a file. Does
> anyone know if there is such a function?  ....... it seems
> that we should have:
> hGetByte :: Handle -> IO Word8

hGetByte could be implemented on top of hGetBuf and StorableArray, but the 
overhead would be ugly.  Recently I needed binary input for similar reasons, 
and would have used hGetByte had it been available.  I ended up performing 
input using a reasonable-sized buffer.


More information about the Libraries mailing list