Liking cljdoc? Tell your friends :D

mqtt.decoding-utils


assert-readable-bytesclj

(assert-readable-bytes buffer expected)

Make sure that there are at least 'expected' more bytes to be read from the buffer. This is to protect against corrupt packets.

Make sure that there are at least 'expected' more bytes to be read from the
buffer. This is to protect against corrupt packets.
raw docstring

has-bad-bytes?clj

(has-bad-bytes? in)

Don't allow �, ? to ?

Don't allow , ? to ?
raw docstring

parse-flagsclj

(parse-flags in & kvs)

Decode a single byte of flags. Takes a list of pairs of keywords and bit-widths. All bit-widths must add up to 8. All 1-bit values are converted to boolean.

Example:

(parse-flags buffer :type 4, :duplicate 1, :qos 2, :retain 1)

Decode a single byte of flags. Takes a list of pairs of keywords and
bit-widths. All bit-widths must add up to 8. All 1-bit values are converted
to boolean.

Example:

  (parse-flags buffer :type 4, :duplicate 1, :qos 2, :retain 1)

raw docstring

parse-short-prefixed-bytesclj

(parse-short-prefixed-bytes in)

Decode a short, then as many bytes as the short says.

Decode a short, then as many bytes as the short says.
raw docstring

parse-stringclj

(parse-string in)

Decode a utf-8 encoded string. Strings are preceeded by 2 bytes describing the length of the remaining content.

Decode a utf-8 encoded string. Strings are preceeded by 2 bytes describing
the length of the remaining content.
raw docstring

parse-unsigned-byteclj

(parse-unsigned-byte in)

Decode a single byte

Decode a single byte
raw docstring

parse-unsigned-shortclj

(parse-unsigned-short in)

Decode an unsigned short

Decode an unsigned short
raw docstring

unsigned-byteclj

(unsigned-byte b)

Cast to unsigned byte. 256 is Byte/MAX_VALUE - Byte/MIN_VALUE.

Cast to unsigned byte.
256 is Byte/MAX_VALUE - Byte/MIN_VALUE.
raw docstring

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

× close