Skip to content

Instantly share code, notes, and snippets.

@lenaschoenburg
Last active December 14, 2015 08:39
Show Gist options
  • Save lenaschoenburg/5059020 to your computer and use it in GitHub Desktop.
Save lenaschoenburg/5059020 to your computer and use it in GitHub Desktop.
(defn buffer-to-string
([^ByteBuffer buff]
(let [decoder (-> (Charset/forName "UTF-8")
(.newDecoder))])
(->> buff
(. decoder decode)
(.toString))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment