CborReader
Reads CBOR data items one at a time from data, for protocol code that parses a fixed structure or a CBOR sequence (RFC 8742), as EDHOC messages are:
val reader = CborReader(message1)
val method = reader.readInt()
val suites = reader.readValue()Accepted: definite-length items of every major type except floating point. Rejected with CborException: indefinite lengths, floats, reserved encodings, integers outside the Long range, invalid UTF-8, truncated input, and nesting deeper than maxDepth.
Encodings that are valid but not the shortest are accepted, so peers with less strict encoders still interoperate. Use readEncodedItem when the exact received bytes matter, as they do for EDHOC transcript hashes.
Properties
Functions
Whether the next item is null, without consuming it.
Reads an array header and returns the number of items that follow.
The exact bytes of the next complete data item, as received.
Reads a map header and returns the number of key/value pairs that follow.