Vector<Integer> rec = new Vector<Integer>(); int[] id = rec.stream().mapToInt(Integer:: valueOf).toArray();