byte array in groovy

arrays, groovy, java

Solution

The following should suffice:

def array = [0, 0, 0, 0, 0] as byte[]

Have a look here for more details on arrays in groovy.

Problem

in java I can create byte array: `byte[] array = new byte[] { 0, 0, 0, 0, 0 };` but this construct is invalid in groovy. How I can create byte array in groovy ?

Original source