MCPcopy Index your code
hub / github.com/clojure/clojure / byte_array

Method byte_array

src/jvm/clojure/lang/Numbers.java:1404–1420  ·  view source on GitHub ↗
(int size, Object init)

Source from the content-addressed store, hash-verified

1402}
1403
1404@WarnBoxedMath(false)
1405static public byte[] byte_array(int size, Object init){
1406 byte[] ret = new byte[size];
1407 if(init instanceof Byte)
1408 {
1409 byte b = (Byte) init;
1410 for(int i = 0; i < ret.length; i++)
1411 ret[i] = b;
1412 }
1413 else
1414 {
1415 ISeq s = RT.seq(init);
1416 for(int i = 0; i < size && s != null; i++, s = s.next())
1417 ret[i] = ((Number) s.first()).byteValue();
1418 }
1419 return ret;
1420}
1421
1422@WarnBoxedMath(false)
1423static public byte[] byte_array(Object sizeOrSeq){

Callers

nothing calls this directly

Calls 6

seqMethod · 0.95
nextMethod · 0.95
firstMethod · 0.95
countMethod · 0.95
byteValueMethod · 0.80
intValueMethod · 0.45

Tested by

no test coverage detected