@davidc I tried it but it doesn't seems to affect the speed.
You might be doing an implicit conversion inside the loop itself, which affects the performance in the same way.
Why not put your ints in an int
That's what I would do if performance was the top priority and the code was being called often enough to warrant it. You lose the flexibility of an array list but avoid autoboxing altogether. If it comes down to it, you can create an array of fixed size and then reallocate if it needs to be bigger. This is fine if you know what the maximum size will be.