Functions for interacting with bytes.
- sourceFile :: ResourceIO m => FilePath -> Source m ByteString
- sourceFileRange :: ResourceIO m => FilePath -> Maybe Integer -> Maybe Integer -> Source m ByteString
- sinkFile :: ResourceIO m => FilePath -> Sink ByteString m ()
- conduitFile :: ResourceIO m => FilePath -> Conduit ByteString m ByteString
- isolate :: Resource m => Int -> Conduit ByteString m ByteString
Documentation
sourceFile :: ResourceIO m => FilePath -> Source m ByteStringSource
Stream the contents of a file as binary data.
:: ResourceIO m | |
=> FilePath | |
-> Maybe Integer | Offset |
-> Maybe Integer | Maximum count |
-> Source m ByteString |
Stream the contents of a file as binary data, starting from a certain offset and only consuming up to a certain number of bytes.
sinkFile :: ResourceIO m => FilePath -> Sink ByteString m ()Source
Stream all incoming data to the given file.
conduitFile :: ResourceIO m => FilePath -> Conduit ByteString m ByteStringSource
Stream the contents of the input to a file, and also send it along the
pipeline. Similar in concept to the Unix command tee
.
isolate :: Resource m => Int -> Conduit ByteString m ByteStringSource
Ensure that only up to the given number of bytes are consume by the inner sink. Note that this does not ensure that all of those bytes are in fact consumed.