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:
-
ClassDescriptionAnnotation that can be applied to classes, fields, and methods to tweak how they are handled by
CborSerializerandCborParser.Utility classes and methods for the@Cborannotation.Builder class.Dynamically applies a@Cborannotation to specified classes, methods, or fields.A collection of@CborApply annotations.Utility classes and methods for the@CborApplyannotation.Applies targetedCborApplyannotations to aContext.Builder.Builder class.Metadata on bean properties specific to the CBOR serializers and parsers pulled from the@Cborannotation on the bean property.Metadata on classes specific to the CBOR serializers and parsers pulled from the@Cborannotation on the class.Annotation for specifying config properties defined inCborSerializerandCborParser.Utility classes and methods for the@CborConfigannotation.AppliesCborConfigannotations to aCborParser.Builder.AppliesCborConfigannotations to aCborSerializer.Builder.Specialized input stream for parsing CBOR streams (RFC 8949).Interface for providing access toCborClassMetaandCborBeanPropertyMetaobjects.Specialized output stream for serializing CBOR streams (RFC 8949).Parses CBOR streams (RFC 8949) into POJO models.Default parser, string input encoded as BASE64.Builder class.Default parser, string input encoded as spaced-hex.Session object that lives for the duration of a single use ofCborParser.Builder class.Serializes POJO models to CBOR (RFC 8949).Default serializer, BASE64 string output.Builder class.Default serializer, spaced-hex string output.Session object that lives for the duration of a single use ofCborSerializer.Builder class.Reference implementation of the publicTokenReadersurface for the CBOR format (RFC 8949).Reference implementation of the publicTokenWritersurface for the CBOR format (RFC 8949).Cursor-level settings honored byCborTokenWriter.