xref: /netbsd-src/external/mit/libcbor/dist/doc/source/streaming.rst (revision eceb233b9bd0dfebb902ed73b531ae6964fa3f9b)
1Streaming & indefinite items
2=============================
3
4CBOR :doc:`strings <api/type_2>`, :doc:`byte strings <api/type_3>`, :doc:`arrays <api/type_4>`, and :doc:`maps <api/type_5>` can be encoded as *indefinite*, meaning their length or size is not specified. Instead, they are divided into *chunks* (:doc:`strings <api/type_2>`, :doc:`byte strings <api/type_3>`), or explicitly terminated (:doc:`arrays <api/type_4>`, :doc:`maps <api/type_5>`).
5
6This is one of the most important (and due to poor implementations, underutilized) features of CBOR. It enables low-overhead streaming just about anywhere without dealing with channels or pub/sub mechanism. It is, however, important to recognize that CBOR streaming is not a substitute for  Websockets [#]_ and similar technologies.
7
8.. [#] :RFC:`6455`
9
10.. toctree::
11
12   streaming/decoding
13   streaming/encoding
14