bytebuf.clj
Branches > namespace-reorganization > 7a196ca > files / src / dev / grahp / bytebuf.clj
(ns dev.grahp.bytebuf
(:import
[io.netty.buffer ByteBuf]
[java.io Writer]))
(defn print-bb [buf]
(mapv #(bit-and % 0xFF)
(subvec (vec (.array buf))
(.readerIndex buf)
(.writerIndex buf))))
(defmethod print-method ByteBuf [bb w]
(Writer/.write w (str "#ByteBuf " (print-bb bb))))