diff --git a/Data/ByteString/Char8/ExplicitIOModes.hs b/Data/ByteString/Char8/ExplicitIOModes.hs
new file mode 100644
--- /dev/null
+++ b/Data/ByteString/Char8/ExplicitIOModes.hs
@@ -0,0 +1,85 @@
+{-# LANGUAGE UnicodeSyntax, NoImplicitPrelude #-}
+
+-------------------------------------------------------------------------------
+-- |
+-- Module      :  Data.ByteString.ExplicitIOModes
+-- Copyright   :  (c) 2009-2010 Bas van Dijk
+-- License     :  BSD3 (see the file LICENSE)
+-- Maintainer  :  Bas van Dijk <v.dijk.bas@gmail.com>
+--
+-- This module lifts the bytestring IO operations to handles with explicit
+-- IOModes.
+--
+-------------------------------------------------------------------------------
+
+module Data.ByteString.Char8.ExplicitIOModes
+    ( hGetLine
+    , hGetContents
+    , hGet
+    , hGetNonBlocking
+
+    , hPut
+    , hPutStr
+    , hPutStrLn
+    ) where
+
+-------------------------------------------------------------------------------
+-- Imports
+-------------------------------------------------------------------------------
+
+-- from base:
+import Data.Int  ( Int )
+import System.IO ( IO )
+
+-- from bytestring:
+import Data.ByteString.Char8                ( ByteString )
+import qualified Data.ByteString.Char8 as B ( hGetLine
+                                            , hGetContents
+                                            , hGet
+                                            , hGetNonBlocking
+
+                                            , hPut
+                                            , hPutStr
+                                            , hPutStrLn
+                                            )
+
+-- from explicit-iomodes:
+import System.IO.ExplicitIOModes        ( Handle, ReadModes, WriteModes )
+import System.IO.ExplicitIOModes.Unsafe ( wrap, wrap2 )
+
+
+-------------------------------------------------------------------------------
+-- ByteString I/O with file handles with explicit IOModes
+-------------------------------------------------------------------------------
+
+-- | Wraps @Data.ByteString.@'B.hGetLine'.
+hGetLine ∷ ReadModes ioMode ⇒ Handle ioMode → IO ByteString
+hGetLine = wrap B.hGetLine
+
+-- | Wraps @Data.ByteString.@'B.hGetContents'.
+hGetContents ∷ ReadModes ioMode ⇒ Handle ioMode → IO ByteString
+hGetContents = wrap B.hGetContents
+
+-- | Wraps @Data.ByteString.@'B.hGet'.
+hGet ∷ ReadModes ioMode ⇒ Handle ioMode → Int → IO ByteString
+hGet = wrap2 B.hGet
+
+-- | Wraps @Data.ByteString.@'B.hGetNonBlocking'.
+hGetNonBlocking ∷ ReadModes ioMode ⇒ Handle ioMode → Int → IO ByteString
+hGetNonBlocking = wrap2 B.hGetNonBlocking
+
+
+-- | Wraps @Data.ByteString.@'B.hPut'.
+hPut ∷ WriteModes ioMode ⇒ Handle ioMode → ByteString → IO ()
+hPut = wrap2 B.hPut
+
+-- | Wraps @Data.ByteString.@'B.hPutStr'.
+hPutStr ∷ WriteModes ioMode ⇒ Handle ioMode → ByteString → IO ()
+hPutStr = wrap2 B.hPutStr
+
+-- | Wraps @Data.ByteString.@'B.hPutStrLn'.
+hPutStrLn ∷ WriteModes ioMode ⇒ Handle ioMode → ByteString → IO ()
+hPutStrLn = wrap2 B.hPutStrLn
+
+
+-- The End ---------------------------------------------------------------------
diff --git a/Data/ByteString/ExplicitIOModes.hs b/Data/ByteString/ExplicitIOModes.hs
new file mode 100644
--- /dev/null
+++ b/Data/ByteString/ExplicitIOModes.hs
@@ -0,0 +1,85 @@
+{-# LANGUAGE UnicodeSyntax, NoImplicitPrelude #-}
+
+-------------------------------------------------------------------------------
+-- |
+-- Module      :  Data.ByteString.ExplicitIOModes
+-- Copyright   :  (c) 2009-2010 Bas van Dijk
+-- License     :  BSD3 (see the file LICENSE)
+-- Maintainer  :  Bas van Dijk <v.dijk.bas@gmail.com>
+--
+-- This module lifts the bytestring IO operations to handles with explicit
+-- IOModes.
+--
+-------------------------------------------------------------------------------
+
+module Data.ByteString.ExplicitIOModes
+    ( hGetLine
+    , hGetContents
+    , hGet
+    , hGetNonBlocking
+
+    , hPut
+    , hPutStr
+    , hPutStrLn
+    ) where
+
+-------------------------------------------------------------------------------
+-- Imports
+-------------------------------------------------------------------------------
+
+-- from base:
+import Data.Int  ( Int )
+import System.IO ( IO )
+
+-- from bytestring:
+import Data.ByteString                ( ByteString )
+import qualified Data.ByteString as B ( hGetLine
+                                      , hGetContents
+                                      , hGet
+                                      , hGetNonBlocking
+
+                                      , hPut
+                                      , hPutStr
+                                      , hPutStrLn
+                                      )
+
+-- from explicit-iomodes:
+import System.IO.ExplicitIOModes        ( Handle, ReadModes, WriteModes )
+import System.IO.ExplicitIOModes.Unsafe ( wrap, wrap2 )
+
+
+-------------------------------------------------------------------------------
+-- ByteString I/O with file handles with explicit IOModes
+-------------------------------------------------------------------------------
+
+-- | Wraps @Data.ByteString.@'B.hGetLine'.
+hGetLine ∷ ReadModes ioMode ⇒ Handle ioMode → IO ByteString
+hGetLine = wrap B.hGetLine
+
+-- | Wraps @Data.ByteString.@'B.hGetContents'.
+hGetContents ∷ ReadModes ioMode ⇒ Handle ioMode → IO ByteString
+hGetContents = wrap B.hGetContents
+
+-- | Wraps @Data.ByteString.@'B.hGet'.
+hGet ∷ ReadModes ioMode ⇒ Handle ioMode → Int → IO ByteString
+hGet = wrap2 B.hGet
+
+-- | Wraps @Data.ByteString.@'B.hGetNonBlocking'.
+hGetNonBlocking ∷ ReadModes ioMode ⇒ Handle ioMode → Int → IO ByteString
+hGetNonBlocking = wrap2 B.hGetNonBlocking
+
+
+-- | Wraps @Data.ByteString.@'B.hPut'.
+hPut ∷ WriteModes ioMode ⇒ Handle ioMode → ByteString → IO ()
+hPut = wrap2 B.hPut
+
+-- | Wraps @Data.ByteString.@'B.hPutStr'.
+hPutStr ∷ WriteModes ioMode ⇒ Handle ioMode → ByteString → IO ()
+hPutStr = wrap2 B.hPutStr
+
+-- | Wraps @Data.ByteString.@'B.hPutStrLn'.
+hPutStrLn ∷ WriteModes ioMode ⇒ Handle ioMode → ByteString → IO ()
+hPutStrLn = wrap2 B.hPutStrLn
+
+
+-- The End ---------------------------------------------------------------------
diff --git a/Data/ByteString/Lazy/Char8/ExplicitIOModes.hs b/Data/ByteString/Lazy/Char8/ExplicitIOModes.hs
new file mode 100644
--- /dev/null
+++ b/Data/ByteString/Lazy/Char8/ExplicitIOModes.hs
@@ -0,0 +1,67 @@
+{-# LANGUAGE UnicodeSyntax, NoImplicitPrelude #-}
+
+-------------------------------------------------------------------------------
+-- |
+-- Module      :  Data.ByteString.ExplicitIOModes
+-- Copyright   :  (c) 2009-2010 Bas van Dijk
+-- License     :  BSD3 (see the file LICENSE)
+-- Maintainer  :  Bas van Dijk <v.dijk.bas@gmail.com>
+--
+-- This module lifts the bytestring IO operations to handles with explicit
+-- IOModes.
+--
+-------------------------------------------------------------------------------
+
+module Data.ByteString.Lazy.Char8.ExplicitIOModes
+    ( hGetContents
+    , hGet
+    , hGetNonBlocking
+
+    , hPut
+    ) where
+
+-------------------------------------------------------------------------------
+-- Imports
+-------------------------------------------------------------------------------
+
+-- from base:
+import Data.Int  ( Int )
+import System.IO ( IO )
+
+-- from bytestring:
+import Data.ByteString.Lazy.Char8                ( ByteString )
+import qualified Data.ByteString.Lazy.Char8 as B ( hGetContents
+                                                 , hGet
+                                                 , hGetNonBlocking
+
+                                                 , hPut
+                                                 )
+
+-- from explicit-iomodes:
+import System.IO.ExplicitIOModes        ( Handle, ReadModes, WriteModes )
+import System.IO.ExplicitIOModes.Unsafe ( wrap, wrap2 )
+
+
+-------------------------------------------------------------------------------
+-- ByteString I/O with file handles with explicit IOModes
+-------------------------------------------------------------------------------
+
+-- | Wraps @Data.ByteString.@'B.hGetContents'.
+hGetContents ∷ ReadModes ioMode ⇒ Handle ioMode → IO ByteString
+hGetContents = wrap B.hGetContents
+
+-- | Wraps @Data.ByteString.@'B.hGet'.
+hGet ∷ ReadModes ioMode ⇒ Handle ioMode → Int → IO ByteString
+hGet = wrap2 B.hGet
+
+-- | Wraps @Data.ByteString.@'B.hGetNonBlocking'.
+hGetNonBlocking ∷ ReadModes ioMode ⇒ Handle ioMode → Int → IO ByteString
+hGetNonBlocking = wrap2 B.hGetNonBlocking
+
+
+-- | Wraps @Data.ByteString.@'B.hPut'.
+hPut ∷ WriteModes ioMode ⇒ Handle ioMode → ByteString → IO ()
+hPut = wrap2 B.hPut
+
+
+-- The End ---------------------------------------------------------------------
diff --git a/Data/ByteString/Lazy/ExplicitIOModes.hs b/Data/ByteString/Lazy/ExplicitIOModes.hs
new file mode 100644
--- /dev/null
+++ b/Data/ByteString/Lazy/ExplicitIOModes.hs
@@ -0,0 +1,73 @@
+{-# LANGUAGE UnicodeSyntax, NoImplicitPrelude #-}
+
+-------------------------------------------------------------------------------
+-- |
+-- Module      :  Data.ByteString.ExplicitIOModes
+-- Copyright   :  (c) 2009-2010 Bas van Dijk
+-- License     :  BSD3 (see the file LICENSE)
+-- Maintainer  :  Bas van Dijk <v.dijk.bas@gmail.com>
+--
+-- This module lifts the bytestring IO operations to handles with explicit
+-- IOModes.
+--
+-------------------------------------------------------------------------------
+
+module Data.ByteString.Lazy.ExplicitIOModes
+    ( hGetContents
+    , hGet
+    , hGetNonBlocking
+
+    , hPut
+    , hPutStr
+    ) where
+
+-------------------------------------------------------------------------------
+-- Imports
+-------------------------------------------------------------------------------
+
+-- from base:
+import Data.Int  ( Int )
+import System.IO ( IO )
+
+-- from bytestring:
+import Data.ByteString.Lazy                ( ByteString )
+import qualified Data.ByteString.Lazy as B ( hGetContents
+                                           , hGet
+                                           , hGetNonBlocking
+
+                                           , hPut
+                                           , hPutStr
+                                           )
+
+-- from explicit-iomodes:
+import System.IO.ExplicitIOModes        ( Handle, ReadModes, WriteModes )
+import System.IO.ExplicitIOModes.Unsafe ( wrap, wrap2 )
+
+
+-------------------------------------------------------------------------------
+-- ByteString I/O with file handles with explicit IOModes
+-------------------------------------------------------------------------------
+
+-- | Wraps @Data.ByteString.@'B.hGetContents'.
+hGetContents ∷ ReadModes ioMode ⇒ Handle ioMode → IO ByteString
+hGetContents = wrap B.hGetContents
+
+-- | Wraps @Data.ByteString.@'B.hGet'.
+hGet ∷ ReadModes ioMode ⇒ Handle ioMode → Int → IO ByteString
+hGet = wrap2 B.hGet
+
+-- | Wraps @Data.ByteString.@'B.hGetNonBlocking'.
+hGetNonBlocking ∷ ReadModes ioMode ⇒ Handle ioMode → Int → IO ByteString
+hGetNonBlocking = wrap2 B.hGetNonBlocking
+
+
+-- | Wraps @Data.ByteString.@'B.hPut'.
+hPut ∷ WriteModes ioMode ⇒ Handle ioMode → ByteString → IO ()
+hPut = wrap2 B.hPut
+
+-- | Wraps @Data.ByteString.@'B.hPutStr'.
+hPutStr ∷ WriteModes ioMode ⇒ Handle ioMode → ByteString → IO ()
+hPutStr = wrap2 B.hPutStr
+
+
+-- The End ---------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,31 @@
+Copyright (c) 2010 Bas van Dijk
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+
+    * The name of Bas van Dijk and the names of contributors may NOT
+      be used to endorse or promote products derived from this
+      software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/explicit-iomodes-bytestring.cabal b/explicit-iomodes-bytestring.cabal
new file mode 100644
--- /dev/null
+++ b/explicit-iomodes-bytestring.cabal
@@ -0,0 +1,27 @@
+name:          explicit-iomodes-bytestring
+version:       0.1
+cabal-version: >=1.6
+build-type:    Simple
+license:       BSD3
+license-file:  LICENSE
+copyright:     2010 Bas van Dijk
+author:        Bas van Dijk
+maintainer:    Bas van Dijk <v.dijk.bas@gmail.com>
+stability:     experimental
+category:      System
+synopsis:      Extends explicit-iomodes with ByteString operations
+description:   Extends @explicit-iomodes@ with @ByteString@ operations
+
+source-repository head
+  Type:     darcs
+  Location: http://code.haskell.org/~basvandijk/code/explicit-iomodes-bytestring
+
+Library
+  GHC-Options: -Wall
+  build-depends: base                 >= 4     && < 4.3
+               , bytestring           >= 0.9   && < 0.10
+               , explicit-iomodes     >= 0.4   && < 0.5
+  exposed-modules: Data.ByteString.ExplicitIOModes
+                   Data.ByteString.Char8.ExplicitIOModes
+                   Data.ByteString.Lazy.ExplicitIOModes
+                   Data.ByteString.Lazy.Char8.ExplicitIOModes
