A low-level I/O provider where the data is bytes in memory. The Word64 offsets currently have no effect on POSIX system or consoles where the implicit behaviour of the C runtime is assumed to move the file pointer on every read/write without needing an explicit seek.
Methods
read :: a -> Ptr Word8 -> Word64 -> Int -> IO IntRead up to the specified number of bytes starting from a specified offset, returning the number of bytes actually read. This function should only block if there is no data available. If there is not enough data available, then the function should just return the available data. A return value of zero indicates that the end of the data stream (e.g. end of file) has been reached.
readNonBlocking :: a -> Ptr Word8 -> Word64 -> Int -> IO (Maybe Int)Read up to the specified number of bytes starting from a specified offset, returning the number of bytes actually read, or Nothing if the end of the stream has been reached.
write :: a -> Ptr Word8 -> Word64 -> Int -> IO ()Write the specified number of bytes starting at a given offset.
writeNonBlocking :: a -> Ptr Word8 -> Word64 -> Int -> IO IntWrite up to the specified number of bytes without blocking starting at a given offset. Returns the actual number of bytes written.