Convert an array of primitive longs into a List of Longs

Posted by CaptainAwesomePants on Stack Overflow See other posts from Stack Overflow or by CaptainAwesomePants
Published on 2009-04-16T00:19:41Z Indexed on 2010/06/02 18:33 UTC
Read the original article Hit count: 180

Filed under:

This may be a bit of an easy, headesk sort of question, but my first attempt surprisingly completely failed to work. I wanted to take an array of primitive longs and turn it into a list, which I attempted to do like this:

long[] input = someAPI.getSomeLongs();
List<Long> = Arrays.asList(input); //Total failure to even compile!

What's the right way to do this?

© Stack Overflow or respective owner

Related posts about java