My question is very close to this question. But it's not the same. I have a method that accepts varargs with a signature like
static void doSomething(byte[]... values)
And a List of byte[] that I want to send to that method.
List<byte[]> myList;
How do I convert myList
to byte[]
varargs to send to doSomething
?
I thought it would be something like
doSomething(myList.toArray(new Byte[][0]));
but that did not work - It says unexpected token at 0]))
.
Thanks in advance.