diff --git a/Changelog.md b/Changelog.md
--- a/Changelog.md
+++ b/Changelog.md
@@ -1,3 +1,7 @@
+### 0.1.1.0
+
+- Using bytestrings when reading from stdin and writing to the temporary file.
+
 ### 0.1.0.0
 
 - Initial version.
diff --git a/GhcStdin.hs b/GhcStdin.hs
--- a/GhcStdin.hs
+++ b/GhcStdin.hs
@@ -15,17 +15,18 @@
 
 module GhcStdin (frontendPlugin) where
 
-import GHC.Paths
+import           GHC.Paths
 #if MIN_VERSION_ghc(9,0,2)
-import GHC.Plugins
+import           GHC.Plugins
 #else
-import GhcPlugins
+import           GhcPlugins
 #endif
-import Control.Monad
-import System.IO
-import System.IO.Temp
-import System.Process
-import System.Exit
+import           Control.Monad
+import qualified Data.ByteString as B
+import           System.IO
+import           System.IO.Temp
+import           System.Process
+import           System.Exit
 
 -- | Frontend plugin for GHC to compile source code from the standard input.
 --
@@ -73,8 +74,8 @@
 compileCodeFromStdin flags _ = liftIO $
     withTempDirectory "." "ghc-stdin" $ \dir ->
         withTempFile dir "ghc-stdin.hs" $ \src hsrc -> do
-            contents <- getContents
-            hPutStr hsrc contents >> hFlush hsrc
+            contents <- B.getContents
+            B.hPutStr hsrc contents >> hFlush hsrc
             (_, _, _, h) <- createProcess $ proc ghc $ src : wordsOfHead flags
             r <- waitForProcess h
             unless (r == ExitSuccess) $ exitWith r
diff --git a/ghc-stdin.cabal b/ghc-stdin.cabal
--- a/ghc-stdin.cabal
+++ b/ghc-stdin.cabal
@@ -1,5 +1,5 @@
 name:                  ghc-stdin
-version:               0.1.0.0
+version:               0.1.1.0
 license:               BSD3
 license-file:          LICENSE
 extra-source-files:    Changelog.md, README.md
@@ -22,6 +22,7 @@
   build-depends:       base >= 4.11.0.0 && < 5,
                        ghc >= 8.4.1,
                        ghc-paths,
+                       bytestring,
                        temporary,
                        process
 
