Encodes and decodes data for storage. Clojure implementation
Encodes and decodes data for storage. Clojure implementation
(decode-length ext paged-rdr pos)
Reads the header to determine length. ext: if true (bit is 0) then length is a byte, if false (bit is 1) then length is in either a short or an int pos: The beginning of the data. This has skipped the type byte. returns: a pair of the header length and the data length.
Reads the header to determine length. ext: if true (bit is 0) then length is a byte, if false (bit is 1) then length is in either a short or an int pos: The beginning of the data. This has skipped the type byte. returns: a pair of the header length and the data length.
Reads the header to determine length. ext: if 0 then length is a byte, if 1 then length is in either a short or an int
Reads the header to determine length. ext: if 0 then length is a byte, if 1 then length is in either a short or an int
(decode-length-node data)
Reads the header to determine length. data: The complete buffer to decode, including the type byte. returns: the length, or a lower bound on the length
Reads the header to determine length. data: The complete buffer to decode, including the type byte. returns: the length, or a lower bound on the length
(decode-length-node b)
(default-decoder ext paged-rdr pos)
This is a decoder for unsupported data that has a string constructor
This is a decoder for unsupported data that has a string constructor
(extract-long id)
Extract a long number from an encapsulating ID
Extract a long number from an encapsulating ID
(extract-sstr id)
Extract a short string from an encapsulating ID
Extract a short string from an encapsulating ID
(long-bytes-compare type-left left-header left-body left-object right-bytes)
Compare data from 2 values that are the same type. If the data cannot give a result then return 0. Operates on an array, expected to be in an index node.
Compare data from 2 values that are the same type. If the data cannot give a result then return 0. Operates on an array, expected to be in an index node.
(map-decoder ext paged-rdr pos)
A decoder for maps. Returns the map and the bytes read.
A decoder for maps. Returns the map and the bytes read.
(partials-len bs)
(partials-len bs len)
Determine the number of bytes that form a partial character at the end of a UTF-8 byte array. The len argument is the defined length of the full string, but that may be greater than the bytes provided.
Determine the number of bytes that form a partial character at the end of a UTF-8 byte array. The len argument is the defined length of the full string, but that may be greater than the bytes provided.
(read-long paged-rdr pos len)
Raw reading of big-endian bytes into a long
Raw reading of big-endian bytes into a long
(read-object paged-rdr pos)
Reads an object from a paged-reader, at id=pos
Reads an object from a paged-reader, at id=pos
(read-object-size paged-rdr pos)
Reads an object from a paged-reader, at id=pos. Returns both the object and it's length.
Reads an object from a paged-reader, at id=pos. Returns both the object and it's length.
(seq-decoder ext paged-rdr pos)
This is a decoder for sequences of data. Use a vector as the sequence.
This is a decoder for sequences of data. Use a vector as the sequence.
(string-style-compare left-s right-bytes)
Compare the string form of an object with bytes that store the string form of an object
Compare the string form of an object with bytes that store the string form of an object
(type-info b)
Returns the type information encoded in a header-byte
Returns the type information encoded in a header-byte
(type-info data)
Map of type codes to decoder functions. Returns object and bytes read.
Map of type codes to decoder functions. Returns object and bytes read.
Map of type codes to decoder functions
Map of type codes to decoder functions
(unencapsulate-id id)
Converts an encapsulating ID into the object it encapsulates. Return nil if it does not encapsulate anything.
Converts an encapsulating ID into the object it encapsulates. Return nil if it does not encapsulate anything.
(unencapsulate-id x)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close