Hey Dirk,
thanks for answering so fast!
As english is not my mother tongue, it seems to me that I put my question a bit too much into the "hey, how can I get the last edge of performance out of my code?"-corner.
Considering myself as a beginner with
java, let me try to put my intention behind the question in other words:
I have an array of primitves. I'd love to transform it into a Collection, to do all the fancy collection-stuff with it.
The only method I found which vaguely does what I want is "Arrays.asList(Object[] a)".
My first question: Is this the only way? Is this okay or does it look too complicated or so? Are there other (better?) methods?
When I'm using this method, I need an array of Objects, not of primitives. The only way I found to get this is to cast element per element from "int" to "Integer".
My second question: Is looping through the whole array the only way? -> If I do so I could also fill a Collection with my array's elements...
From my practise in other languages and my impression of Java I feel that there might be a simple one-liner of code, recieving my array of primitives and returning a object of a class that implements Collection.
If you say "no, the way is definitely okay", I'll be more then happy. Otherwise, just let me know how you would have solved this "problem"
;-)
Greetings from Berlin, Germany
Jan