(def-from sym doc-string klass)
Defines a type-hinted (per <klass>) function named <sym> taking 1 or 2 args,
which delegates to from-bytes
(hard-coding <klass> as the first argument to it).
This (obviously) won't work for java.io.Serializable
.
Defines a type-hinted (per <klass>) function named <sym> taking 1 or 2 args, which delegates to `from-bytes` (hard-coding <klass> as the first argument to it). This (obviously) won't work for `java.io.Serializable`.
(from-bytes klass x)
(from-bytes klass x opts)
Wrapper around fromBytes
multi-method.
Turns byte-array <x> into an object.
Requires type-hinting at the call-site.
See def-from
for defining type-hinted variants.
Wrapper around `fromBytes` multi-method. Turns byte-array <x> into an object. Requires type-hinting at the call-site. See `def-from` for defining type-hinted variants.
(from-cbor-bytes x)
(from-cbor-bytes x opts)
Wrapper around cbor/fromCBOR
protocol.
Turns <x> (byte-array/ByteBuffer/InputStream/File)
into an object.
Wrapper around `cbor/fromCBOR` protocol. Turns <x> (byte-array/ByteBuffer/InputStream/File) into an object.
(to-bytes x)
(to-bytes x opts)
Wrapper fn around toBytes
protocol. Turns <x> into a byte-array (per applicable <opts>).
Does not close any input-streams other than the one(s) internally created
(i.e. if <x> is one it will NOT be closed).
Wrapper fn around `toBytes` protocol. Turns <x> into a byte-array (per applicable <opts>). Does not close any input-streams other than the one(s) internally created (i.e. if <x> is one it will NOT be closed).
(to-cbor-bytes x)
(to-cbor-bytes x opts)
Wrapper fn around array/toBytes
protocol.
Turns object <x> into a CBOR-encoded byte-array (per applicable <opts>).
Does not close any input-streams other than the one(s) internally
created (i.e. if <x> is one it will NOT be closed).
Wrapper fn around `array/toBytes` protocol. Turns object <x> into a CBOR-encoded byte-array (per applicable <opts>). Does not close any input-streams other than the one(s) internally created (i.e. if <x> is one it will NOT be closed).
(with-length-prefix encoding byte-order bs)
Returns a new byte-array whose N (depends on <encoding>) first bytes
denote the length of the provided bytes <bs>. :int16
(2-byte),
:int32
(4-byte) & :int64
(8-byte) encodings are supported.
Returns a new byte-array whose N (depends on <encoding>) first bytes denote the length of the provided bytes <bs>. `:int16` (2-byte), `:int32` (4-byte) & `:int64` (8-byte) encodings are supported.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close