Liking cljdoc? Tell your friends :D

hara.io.binary.buffer


+buffer-functions+clj


+buffer-lookup+clj


+buffer-records+clj


+buffer-typeclj

(+buffer-type ??)
?? invalid arglists:
()

cache for hara.io.binary.buffer/buffer-type

cache for hara.io.binary.buffer/buffer-type
raw docstring

+endian+clj


+endian-native+clj


bufferclj

(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
raw docstring

buffer-convertclj

(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
raw docstring

buffer-createclj

(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
raw docstring

buffer-primitiveclj

(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
raw docstring

buffer-readclj

(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
raw docstring

buffer-typeclj

(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
raw docstring

buffer-type-rawclj

(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
raw docstring

buffer-writeclj

(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]
raw docstring

byte-bufferclj

(byte-buffer len-or-elems)
(byte-buffer len-or-elems {:keys [type direct endian convert] :as opts})

byte-orderclj

(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
raw docstring

char-bufferclj

(char-buffer len-or-elems)
(char-buffer len-or-elems {:keys [type direct endian convert] :as opts})

create-buffer-functionscljmacro

(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)))
raw docstring

create-buffer-recordscljmacro

(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])))
raw docstring

double-bufferclj

(double-buffer len-or-elems)
(double-buffer len-or-elems {:keys [type direct endian convert] :as opts})

float-bufferclj

(float-buffer len-or-elems)
(float-buffer len-or-elems {:keys [type direct endian convert] :as opts})

int-bufferclj

(int-buffer len-or-elems)
(int-buffer len-or-elems {:keys [type direct endian convert] :as opts})

long-bufferclj

(long-buffer len-or-elems)
(long-buffer len-or-elems {:keys [type direct endian convert] :as opts})

short-bufferclj

(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