Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to initialize a byte array in Clojure

What's the syntax for creating a byte array in Clojure initialized to a specified collection of values?

Something like this, but that works...

(byte-array [0 1 2 3])

like image 894
justinhj Avatar asked Dec 10 '10 22:12

justinhj


Video Answer


1 Answers

(byte-array (map byte [0 1 2 3]))

afaik Clojure has no byte literals.

like image 198
Maurits Rijk Avatar answered Oct 15 '22 11:10

Maurits Rijk