 
 
 (defn- bytebuffer->bytes
-  [bb]
+  [^ByteBuffer bb]
   (if (.hasArray bb)
     (Arrays/copyOfRange (.array bb)
                         (+ (.position bb) (.arrayOffset bb))


(defn- read-session-data
  [key]
  (when-let [data (do-prepared (deref read-query) session-consistency key)]
    (when-not (.isEmpty data)
      (-> (.. data one (getBytes "data") slice)
          bytebuffer->bytes

        result (QueryProcessor/processPrepared pp-query consistency query-state
                                               (map ->bytebuffer args))]
    (when (instance? ResultMessage$Rows result)
      (UntypedResultSet. (.result ^ResultMessage$Rows result)))))


;;; Session Cassandra definitions.
