How to cast from List to double[] in Java?
With java-8, you can do it this way. double[] arr = frameList.stream().mapToDouble(Double::doubleValue).toArray(); //via method reference double[] arr = frameList.stream().mapToDouble(d -> d).toArray(); //identity function, Java unboxes automatically to get the double value What it does is : get the Stream<Double> from the list map each double instance to its primitive value, resulting in a DoubleStream call … Read more