How to convert byte to string and convert string to byte on Clojure

Byte,String 在clojure中互转:

(ns test
  (:require [clojure.string]
            [clojure.stacktrace]
            [clojure.tools.logging :as log]
            ))
(defn- string-to-bytes [s] (.getBytes s))
(defn- bytes-to-string [b] (String. b))

(def test (string-to-bytes "abcdefg"))
(println (apply str (bytes-to-string test)))

Grizzly

Never say never!