 
 (def- text-handler
   (generic-handler
-    (fn [#^Socket socket] (PrintWriter. (BufferedWriter. (OutputStreamWriter. (.getOutputStream socket)))))
-    (fn [#^Socket socket] (PushbackReader. (BufferedReader. (InputStreamReader. (.getInputStream  socket)))))
+    (fn [#^OutputStream os] (PrintWriter. (BufferedWriter. (OutputStreamWriter. os))))
+    (fn [#^InputStream is] (PushbackReader. (BufferedReader. (InputStreamReader. is))))
     (fn [#^PushbackReader in eof-val] (read in false eof-val))
     (fn [#^PrintWriter out [resp-code resp-val :as resp]]
       (if (#{0 1} resp-code)

  (fn [dba #^Socket socket]
    (try
      (with-open [socket socket
                  out    (init-out socket)
                  in     (init-in  socket)]
        (.setKeepAlive socket true)
        (loop []
          (if (try

  (:import  (java.net ServerSocket Socket InetAddress)
            (java.io PushbackReader BufferedReader InputStreamReader
                     PrintWriter    BufferedWriter OutputStreamWriter
                     DataInputStream  BufferedInputStream  InputStream
                     DataOutputStream BufferedOutputStream OutputStream)
            (joptsimple OptionParser OptionSet OptionException))
  (:gen-class))

