diff --git a/src/java/com/samskivert/util/IntListUtil.java b/src/java/com/samskivert/util/IntListUtil.java index b07dd4d7..42029f1e 100644 --- a/src/java/com/samskivert/util/IntListUtil.java +++ b/src/java/com/samskivert/util/IntListUtil.java @@ -20,8 +20,10 @@ package com.samskivert.util; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.List; /** * This class manages arrays of ints. Some of those routines mimic the @@ -504,6 +506,21 @@ public class IntListUtil return boxed; } + /** + * Converts an array of primitives to a list of Integers. + */ + public static List asList (int[] list) + { + if (list == null) { + return null; + } + List ilist = new ArrayList(list.length); + for (int ii = 0; ii < list.length; ii++) { + ilist.add(list[ii]); + } + return ilist; + } + /** * Converts an array of Integer objects to an array of primitives. */