File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ module Streaming.Zip (
44 -- * Streams
55 decompress
66 , decompress'
7+ , decompressAll
78 , compress
89 , gunzip
910 , gunzip'
@@ -83,6 +84,14 @@ decompress' wbits p0 = go p0 =<< liftIO (Z.initInflate wbits)
8384 else return $ Left (chunk leftover >> p')
8485{-# INLINABLE decompress' #-}
8586
87+ -- | Keep decompressing a compressed bytestream until exhausted.
88+ decompressAll :: MonadIO m => Z. WindowBits -> ByteString m r -> ByteString m r
89+ decompressAll w bs = decompress' w bs >>= go
90+ where
91+ go (Left bs) = decompress' w bs >>= go
92+ go (Right r) = return r
93+ {-# INLINABLE decompressAll #-}
94+
8695-- | Compress a byte stream.
8796--
8897-- See the "Codec.Compression.Zlib" module for details about
You can’t perform that action at this time.
0 commit comments