diff --git a/hw-prim.cabal b/hw-prim.cabal
--- a/hw-prim.cabal
+++ b/hw-prim.cabal
@@ -3,7 +3,7 @@
 -- see: https://github.com/sol/hpack
 
 name:           hw-prim
-version:        0.6.2.10
+version:        0.6.2.11
 synopsis:       Primitive functions and data types
 description:    Primitive functions and data types.
 category:       Data
diff --git a/src/HaskellWorks/Data/ByteString.hs b/src/HaskellWorks/Data/ByteString.hs
--- a/src/HaskellWorks/Data/ByteString.hs
+++ b/src/HaskellWorks/Data/ByteString.hs
@@ -7,6 +7,7 @@
   , resegment
   , resegmentPadded
   , rechunk
+  , hGetContentsChunkedBy
   ) where
 
 import Data.Semigroup ((<>))
@@ -16,6 +17,8 @@
 import qualified Data.ByteString.Internal as BSI
 import qualified Data.ByteString.Lazy     as LBS
 import qualified Data.Vector.Storable     as DVS
+import qualified System.IO                as IO
+import qualified System.IO.Unsafe         as IO
 
 class ToByteString a where
   toByteString :: a -> BS.ByteString
@@ -148,3 +151,12 @@
                     then bs:go bss
                     else BS.take bsCroppedLen bs:go (BS.drop bsCroppedLen bs:bss)
         go [] = []
+
+hGetContentsChunkedBy :: Int -> IO.Handle -> IO [BS.ByteString]
+hGetContentsChunkedBy k h = lazyRead
+  where lazyRead = IO.unsafeInterleaveIO loop
+        loop = do
+            c <- BSI.createAndTrim k $ \p -> IO.hGetBuf h p k
+            if BS.null c
+              then IO.hClose h >> return []
+              else (c:) <$> lazyRead
