Liking cljdoc? Tell your friends :D

clj-cbor.header

Functions for reading and writing CBOR headers.

Functions for reading and writing CBOR headers.
raw docstring

decodeclj

(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
sourceraw docstring

major-typesclj

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)
sourceraw docstring

read-byteclj

(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.
sourceraw docstring

read-codeclj

(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.
sourceraw docstring

read-intclj

(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.
sourceraw docstring

read-longclj

(read-long in)

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 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
sourceraw docstring

read-shortclj

(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.
sourceraw docstring

writeclj

(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.
sourceraw docstring

write-byteclj

(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.
sourceraw docstring

write-intclj

(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.
sourceraw docstring

write-leaderclj

(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.
sourceraw docstring

write-longclj

(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.
sourceraw docstring

write-shortclj

(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.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close