Package org.apache.juneau.marshall.cbor


package org.apache.juneau.marshall.cbor
CBOR (Concise Binary Object Representation) marshalling support per RFC 8949.

CBOR is a binary data format designed for extremely small code size, very small message size, and extensibility. It is widely used in IoT, constrained environments, COSE (CBOR Object Signing and Encryption), and WebAuthn.

CBOR shares the same data model as JSON: maps, arrays, strings, numbers, booleans, and null. The CborSerializer and CborParser provide binary encoding/decoding with compact integer representation and native byte strings.

Type mapping:

  • Java beans / Map → CBOR map (major type 5)
  • Collection / array → CBOR array (major type 4)
  • String / Enum → CBOR text string (major type 3)
  • Integer types → CBOR unsigned/negative integer (major types 0/1)
  • Float / Double → CBOR IEEE 754 float (major type 7)
  • Boolean → CBOR simple values 20/21
  • null → CBOR simple value 22
  • byte[] → CBOR byte string (major type 2)
See Also: