Copyright | © 2015 Patryk Zadarnowski <pat@jantar.org> |
---|---|
License | BSD3 |
Maintainer | pat@jantar.org |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
When binary data is streamed through a pipe, it's often partitioned arbitrarily into packets with no semantic significance, beyond facilitation of processing in constant space. This is similar to the chunking mechanism within lazy bytestrings, and, accordingly, it's often convenient to unify the two mechanisms, by converting between pipes over lazy bytestrings and pipes over strict chunks these bytestrings. This module provides efficient implementations of these conversions.
- toChunks :: Monad m => Pipe Lazy.ByteString ByteString.ByteString m r
- fromChunks :: Monad m => Int64 -> Int64 -> Pipe ByteString.ByteString Lazy.ByteString m r
Documentation
toChunks :: Monad m => Pipe Lazy.ByteString ByteString.ByteString m r Source
An infinite pipe that converts lazy bytestring input into strict bytestring chunk output.
fromChunks :: Monad m => Int64 -> Int64 -> Pipe ByteString.ByteString Lazy.ByteString m r Source
An infinite pipe that converts strict bytestrings into lazy bytestrings with the specified minimum and maximum size, without copying any data.