b785a33
Branches > facts > b785a33 > files / .gitignore
transport.streams docstrings
Commit: b785a33ce0d7b734a7d9c04a740bd22cf35294b2
Parent: 4865386
1 changed file:
src/net/bowmap/transport/streams.clj view file
@@ -10,8 +10,6 @@ InputStream OutputStream])) -; TODO move this all out to somewhere else, I don't like it here.- (defn read-byte!! "Blocks and returns an unsigned byte from 'input-stream', or throws if EOF is reached" [input-stream]@@ -34,7 +32,7 @@ (recur (inc num-read) result')))))) (defn read-frame!!- "Reads a frame from 'input-stream', or throws if one cannot be read"+ "Blocks and reads a frame from 'input-stream'. Throws if one cannot be read" [input-stream] (let [len (read-varint!! input-stream) arr (byte-array len)]@@ -46,7 +44,9 @@ (recur (+ offset r)))))) (Unpooled/wrappedBuffer arr))) -(defn write-frame!! [frame output-stream]+(defn write-frame!!+ "Blocks and writes a frame to 'output-stream'. Throws if it cannot be written."+ [frame output-stream] (let [len (ByteBuf/.readableBytes frame) arr (byte-array len)] (ByteBuf/.readBytes frame arr)