Once again, Apache Commons Lang is your friend. They provide ArrayUtils.toPrimitive() which does exactly what you need. You can specify how you want to handle nulls.
More Related Contents:
- How to convert an ArrayList containing Integers to primitive int array?
- Is a Java array of primitives stored in stack or heap?
- Compare two arrays of primitives in Java?
- What does the statement Object[][] data = new Object [][] mean?
- 7-dimensional vector Java
- What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it?
- Converting ‘ArrayList to ‘String[]’ in Java
- How to create a generic array in Java?
- Delete item from array and shrink array [duplicate]
- Using GSON to parse a JSON array
- Java – generate Random range of specific numbers without duplication of those numbers – how to?
- What is the most elegant way to check if all values in a boolean array are true?
- Java String array: is there a size of method?
- How to get the Array Class for a given Class in Java?
- Java array with more than 4gb elements
- Find duplicate element in array in time O(n)
- String array initialization in Java [duplicate]
- Read .txt file into 2D Array
- Setting Short Value Java
- Java: Multi-dimensional array vs. one-dimensional
- Arrays in Java and how they are stored in memory
- Print array without brackets and commas
- Multi-dimensional array transposing
- Java: are 1-d arrays always contiguous in memory?
- Java: Array with loop
- find an element in a sorted matrix [duplicate]
- Java equivalent to Explode and Implode(PHP) [closed]
- Are arrays thread-safe in Java?
- How can I turn a JSONArray into a JSONObject?
- How to convert Integer[] to int[] array in Java?