Skip to content

Commit 1e35b41

Browse files
committed
add docs to pack/pack-stream
1 parent f2ed87a commit 1e35b41

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/msgpack/core.clj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,17 @@
215215
(pack-bytes bytes s)))})
216216

217217
(defn pack-stream
218+
"Serialize application value as a stream of MessagePack-formatted bytes.
219+
Argument type can be either java.io.DataOutput or java.io.OutputStream. Any
220+
other type is an error."
218221
([this stream] (pack-stream this stream nil))
219222
([this stream opts]
220223
(condp instance? stream
221224
DataOutput (packable-pack this stream opts)
222225
OutputStream (pack-stream this (DataOutputStream. stream) opts))))
223226

224227
(defn pack
228+
"Serialize application value as a MessagePack-formatted byte array"
225229
([obj] (pack obj nil))
226230
([obj opts]
227231
(let [stream (ByteArrayOutputStream.)]

0 commit comments

Comments
 (0)