store/[org.clojure/clojure "1.8.0"] clj::clojure.core/byte-array

Official Documentation

Add notes
Arities
==================================================
   [size-or-seq]
   [size init-val-or-seq]

Docstring
==================================================
  Creates an array of bytes

Source

(defn byte-array
  "Creates an array of bytes"
  {:inline (fn [& args] `(. clojure.lang.Numbers byte_array ~@args))
   :inline-arities #{1 2}
   :added "1.1"}
  ([size-or-seq] (. clojure.lang.Numbers byte_array size-or-seq))
  ([size init-val-or-seq] (. clojure.lang.Numbers byte_array size init-val-or-seq)))

Example 1

Edit
;; create an array of bytes
;; and demonstrate that you can use it in the standard Java fill function
;; note the needed byte coercion in the fill function call

(def bees (byte-array 10))
;; => #'user/bees

(for [i (range 10)] (aset-byte bees i (* i i)))
;; => (0 1 4 9 16 25 36 49 64 81)

(vec bees)
;; => [0 1 4 9 16 25 36 49 64 81]

(java.util.Arrays/fill bees (byte 122))
;; => nil

(vec bees)
;; => [122 122 122 122 122 122 122 122 122 122]

Uses on crossclj