ptr-0.16.2: Abstractions for operations on pointers
Ptr.Receive
Synopsis
data Receive Source #
A wrapper of a receiving action, which extends it with bufferization.
create :: (Ptr Word8 -> Int -> IO (Either Text Int)) -> Int -> IO Receive Source #
peek :: Receive -> Peek peekd -> IO (Either Text peekd) Source #
Receive as many bytes as is required by the provided decoder and decode immediately.
If all you need is just to get a ByteString chunk then use the bytes decoder.
ByteString
bytes