(+buffer-type ??)
()
cache for hara.io.binary.buffer/buffer-type
cache for hara.io.binary.buffer/buffer-type
(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-convert buff type)
converts an nio ByteBuffer to another type
(buffer-convert (java.nio.ByteBuffer/allocate 8) :double) => java.nio.DoubleBuffer
converts an nio ByteBuffer to another type (buffer-convert (java.nio.ByteBuffer/allocate 8) :double) => java.nio.DoubleBuffer
(buffer-create type elems length direct endian convert)
creates a byte buffer
(buffer-create :double (double-array [1 2 3 4]) 4 true :little true) => java.nio.DoubleBuffer
(buffer-create :double (double-array [1 2 3 4]) 4 false :big false) => java.nio.ByteBuffer
creates a byte buffer (buffer-create :double (double-array [1 2 3 4]) 4 true :little true) => java.nio.DoubleBuffer (buffer-create :double (double-array [1 2 3 4]) 4 false :big false) => java.nio.ByteBuffer
(buffer-primitive buff)
(buffer-primitive buff tag)
returns the corresponding type associated with the instance
(buffer-primitive (double-buffer 0) :class) => Double/TYPE
returns the corresponding type associated with the instance (buffer-primitive (double-buffer 0) :class) => Double/TYPE
(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-type cls)
(buffer-type cls tag)
returns the corresponding type associated with the class
(buffer-type java.nio.FloatBuffer :type) => :float
(buffer-type java.nio.FloatBuffer :array-fn) => float-array
returns the corresponding type associated with the class (buffer-type java.nio.FloatBuffer :type) => :float (buffer-type java.nio.FloatBuffer :array-fn) => float-array
(buffer-type-raw cls)
(buffer-type-raw cls tag)
helper function for hara.io.binary.buffer/buffer-type
helper function for hara.io.binary.buffer/buffer-type
(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})
(byte-order obj)
converts keyword to ByteOrder
(byte-order :little) => java.nio.ByteOrder/LITTLE_ENDIAN
converts keyword to ByteOrder (byte-order :little) => java.nio.ByteOrder/LITTLE_ENDIAN
(char-buffer len-or-elems)
(char-buffer len-or-elems {:keys [type direct endian convert] :as opts})
(create-buffer-functions types)
creates functions for buffer types
(macroexpand-1 '(create-buffer-functions (:byte)))
creates functions for buffer types (macroexpand-1 '(create-buffer-functions (:byte)))
(create-buffer-records types)
creates records for buffer types
(macroexpand-1 '(create-buffer-records ([Byte identity])))
creates records for buffer types (macroexpand-1 '(create-buffer-records ([Byte identity])))
(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})
(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})
(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