(bitseq obj)
converts to a bitseq binary representation
(binary/bitseq (byte-array [49])) => [1 0 0 0 1 1]
converts to a bitseq binary representation (binary/bitseq (byte-array [49])) => [1 0 0 0 1 1]
(bitset obj)
converts to a bitset binary representation
(-> (binary/bitset "100011") (bitset-to-bitseq)) => [1 0 0 0 1 1]
converts to a bitset binary representation (-> (binary/bitset "100011") (bitset-to-bitseq)) => [1 0 0 0 1 1]
(bitstr obj)
converts to a bitstr binary representation
(binary/bitstr (byte-array [49])) => "100011"
converts to a bitstr binary representation (binary/bitstr (byte-array [49])) => "100011"
(buffer len-or-elems)
(buffer
len-or-elems
{:keys [type direct endian convert wrap]
:or
{type :byte direct false endian +endian-native+ convert true wrap false}})
either creates or wraps a byte buffer of a given type
(buffer 10) => java.nio.ByteBuffer
(buffer 10 {:type :float :convert false}) => java.nio.ByteBuffer
(buffer 10 {:type :float :direct true}) => java.nio.FloatBuffer
either creates or wraps a byte buffer of a given type (buffer 10) => java.nio.ByteBuffer (buffer 10 {:type :float :convert false}) => java.nio.ByteBuffer (buffer 10 {:type :float :direct true}) => java.nio.FloatBuffer
(buffer-read buff)
(buffer-read buff arr)
reads primitive array from buffer
(def -buf- (buffer 4)) (def -out- (int-array 1))
(do (.put -buf- 3 (byte 1)) (buffer-read -buf- -out-) (first -out-)) => 1
reads primitive array from buffer (def -buf- (buffer 4)) (def -out- (int-array 1)) (do (.put -buf- 3 (byte 1)) (buffer-read -buf- -out-) (first -out-)) => 1
(buffer-write buff arr)
writes primitive array to a buffer
(def -buf- (buffer 16)) (buffer-write -buf- (int-array [1 2 3 4]))
[(.get -buf- 3) (.get -buf- 7) (.get -buf- 11) (.get -buf- 15)] => [1 2 3 4]
writes primitive array to a buffer (def -buf- (buffer 16)) (buffer-write -buf- (int-array [1 2 3 4])) [(.get -buf- 3) (.get -buf- 7) (.get -buf- 11) (.get -buf- 15)] => [1 2 3 4]
(byte-buffer len-or-elems)
(byte-buffer len-or-elems {:keys [type direct endian convert] :as opts})
(bytes obj)
converts to a byte array binary representation
(-> (binary/bytes "100011") (seq)) => [49]
converts to a byte array binary representation (-> (binary/bytes "100011") (seq)) => [49]
(char-buffer len-or-elems)
(char-buffer len-or-elems {:keys [type direct endian convert] :as opts})
(double-buffer len-or-elems)
(double-buffer len-or-elems {:keys [type direct endian convert] :as opts})
(float-buffer len-or-elems)
(float-buffer len-or-elems {:keys [type direct endian convert] :as opts})
(input-stream obj)
creates an inputstream from various representations
(input-stream 9223372036854775808N) => java.io.ByteArrayInputStream
creates an inputstream from various representations (input-stream 9223372036854775808N) => java.io.ByteArrayInputStream
(int-buffer len-or-elems)
(int-buffer len-or-elems {:keys [type direct endian convert] :as opts})
(long-buffer len-or-elems)
(long-buffer len-or-elems {:keys [type direct endian convert] :as opts})
(number obj)
converts to a number binary representation
(binary/number "100011") => 49
converts to a number binary representation (binary/number "100011") => 49
(output-stream obj)
creates an inputstream from various representations
(output-stream (fs/file "project.clj")) => java.io.FileOutputStream
creates an inputstream from various representations (output-stream (fs/file "project.clj")) => java.io.FileOutputStream
(short-buffer len-or-elems)
(short-buffer len-or-elems {:keys [type direct endian convert] :as opts})
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close