9c9cb1f

Bowmap · bowmap.git · Tickets

Branches > main > 9c9cb1f > files

Add print support to write buffers

Grahp, 2026-09-30

Commit: 9c9cb1feac253188f4c2fa387dd4f04733d3785c
Parent: 2783a52

1 changed file:

src/net/bowmap/server/protocol/buffer.clj modified (view file)

@@ -16,9 +16,16 @@  (defn write-buffer []   (let [baos (ByteArrayOutputStream.)]+    ^{:type ::write-buffer}     (reify WriteBuffer       (write-byte! [buf b]         (^[int] ByteArrayOutputStream/.write baos (bit-and 0xFF b))         buf)       (->frame [_]         (frame/frame (ByteArrayOutputStream/.toByteArray baos))))))++(defmethod print-method ::write-buffer [buf writer]+  (frame/write! (->frame buf)+                (fn [array length]+                  (.write writer "#WriteBuffer ")+                  (.write writer (pr-str (subvec (vec array) 0 length))))))