Created
May 7, 2014 16:00
-
-
Save AdamClements/9441ad39254b91a8718b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn dump [^ByteBuffer b] | |
(let [readcopy (.asReadOnlyBuffer b)] | |
(.rewind readcopy) | |
(for [i (range (/ (.limit readcopy) 4))] | |
(.getInt readcopy)))) | |
(defmethod print-method ByteBuffer | |
[v ^java.io.Writer w] | |
(.write w (str "#<ByteBuffer" (pr-str (dump v)) ">"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment