C
Chris Smowton
I've seen a few things on the internet say that if you want a list from
an array, you should go
int[] test = {1, 2, 3, 4, 5};
List myList = Arrays.toList(test);
However, on Java 5 this doesn't seem to work, it tries to produce a
List<Integer[]> instead of a List<Integer>.
Obviously I could fix this by calling toList(1, 2, 3, 4, 5), but this
is hardly practical when a function returns a long array.
For the record, the specific application is I want an ArrayList of the
UTF-8 bytes of some string.
Thanks if anyone can help,
Chris
an array, you should go
int[] test = {1, 2, 3, 4, 5};
List myList = Arrays.toList(test);
However, on Java 5 this doesn't seem to work, it tries to produce a
List<Integer[]> instead of a List<Integer>.
Obviously I could fix this by calling toList(1, 2, 3, 4, 5), but this
is hardly practical when a function returns a long array.
For the record, the specific application is I want an ArrayList of the
UTF-8 bytes of some string.
Thanks if anyone can help,
Chris