Data Types
TODO
CBOR Data Types
CBOR in itself has 8 so-called major data types. Those data types represent all information stored in a data stream. Complex information, however, can combine elements in a more meaningful way, as well as tag them to give a clearer meaning.
The common data types are:
Item Type | Data Type | Description | Java Representation |
---|---|---|---|
0x00 |
UInt |
Unsigned integer which can hold any positive value up to 64 bits. |
|
0x01 |
NInt |
Negative integer which can hold any negative value up to 64 bits. |
|
0x02 |
ByteString |
A fixed sized byte stream to contain arbitrary encoded or unencoded byte information. |
|
0x03 |
TextString |
A string that contains non-ASCII characters and can be encoded in UTF-8. When writing these kinds of strings or reading them from a data stream encoding and decoding takes place. |
|
0x04 |
Sequence or Array or List |
A container element that contains a stream of an either fixed or indefinite number of further elements. |
|
0x05 |
Dictionary or Map |
A container element that contains a stream of an either fixed or indefinite number of key-value pairs of elements. |
|
0x06 |
Semantic Tag |
A semantic tag is used as an additional tagging in front of another element. The tag tells the parser that the following item is further specified. A classic example is a DateTime-Tag (TagId: 0) to tell the parser that the following |
Depends on the semantic tag’s id. A meaningful Java 8 representation of the CBOR’s data item. That said date and time elements, for example, will return values of the new Java 8 DateTime API but understand Calendar and Date based values. |
0x07 |
Floating Point or Simple Value |
This data type is more complex, as some content encodes simple values like null, true or false. On the other hand half, single or double precision float values will be stored. Values can be positive or negative. |
|
Apart from those basic major types, borabora has a number of built-in semantic tags to support a variety of additional data types.
Provided Extension Types
TODO
borabora Data Types
TODO
The Value Class
TODO
Sequences
TODO
Dictionaries
TODO