Library to support reading/writing binary files.
Author: Michael Hanus
Version: December 2020
openBinaryFile
:: String -> IOMode -> IO Handle
Like System.IO.openFile, but open the file in binary mode. |
hGetByte
:: Handle -> IO Int
Reads a byte from an input handle associated to a binary stream and returns it. |
hPutByte
:: Handle -> Int -> IO ()
Puts a byte to an output handle associated to a binary stream. |
hGetBinaryContents
:: Handle -> IO [Int]
Reads the complete contents from an input handle and closes the input handle before returning the contents. |
Like System.IO.openFile, but open the file in binary mode. Thus, no translation of character is performed when reading or writing a file. Returns a handle to read and write the binary stream (e.g., with operations hGetByte and hPutByte). |
Reads a byte from an input handle associated to a binary stream and returns it. Throws an error if the end of file has been reached or the stream is not binary. |
Reads the complete contents from an input handle and closes the input handle before returning the contents. |