Functions for reading and writing CBOR headers.
Functions for reading and writing CBOR headers.
(decode header)
Determines the major type keyword and additional information encoded by the header byte. §2.1
Determines the major type keyword and additional information encoded by the header byte. §2.1
Vector of major type keywords, indexed by the three-bit values 0-7. (§2.1)
Vector of major type keywords, indexed by the three-bit values 0-7. (§2.1)
(read-byte in)
Read an unsigned byte (8-bit) value from the data input stream. Promotes the value to a long for consistency.
Read an unsigned byte (8-bit) value from the data input stream. Promotes the value to a long for consistency.
(read-code in info)
Reads a size value from the initial bytes of the input stream. Returns
either a number, the keyword :indefinite
, or calls the error handler on
reserved info codes.
Reads a size value from the initial bytes of the input stream. Returns either a number, the keyword `:indefinite`, or calls the error handler on reserved info codes.
(read-int in)
Read an unsigned int (32-bit) value from the data input stream. Promotes the value to a long for consistency.
Read an unsigned int (32-bit) value from the data input stream. Promotes the value to a long for consistency.
(read-long in)
Read an unsigned long (64-bit) value from the data input stream. Handles overflowing values by promoting them to a bigint.
Read an unsigned long (64-bit) value from the data input stream. Handles overflowing values by promoting them to a bigint. https://tools.ietf.org/html/rfc7049#section-1.2
(read-short in)
Read an unsigned short (16-bit) value from the data input stream. Promotes the value to a long for consistency.
Read an unsigned short (16-bit) value from the data input stream. Promotes the value to a long for consistency.
(write out mtype i)
Writes a header byte for the given major-type, plus extra bytes to encode the given integer code. Always writes the smallest possible representation. Returns the number of bytes written.
Writes a header byte for the given major-type, plus extra bytes to encode the given integer code. Always writes the smallest possible representation. Returns the number of bytes written.
(write-byte out i)
Write an unsigned byte (8-bit) value to the data output stream.
Write an unsigned byte (8-bit) value to the data output stream.
(write-int out i)
Write an unsigned int (32-bit) value to the data output stream. Coerces the value into a signed representation before writing if necessary.
Write an unsigned int (32-bit) value to the data output stream. Coerces the value into a signed representation before writing if necessary.
(write-leader out mtype info)
Writes a header byte for the given major-type and additional info numbers.
Writes a header byte for the given major-type and additional info numbers.
(write-long out i)
Write a long (32-bit) value to the data output stream. Coerces the value into a signed representation before writing if necessary.
Write a long (32-bit) value to the data output stream. Coerces the value into a signed representation before writing if necessary.
(write-short out i)
Write an unsigned short (16-bit) value to the data output stream.
Write an unsigned short (16-bit) value to the data output stream.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close