Java List to Long Number Array toLongArray(List list)

Here you can find the source of toLongArray(List list)

Description

to Long Array

License

Open Source License

Declaration

public static long[] toLongArray(List<Integer> list) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Iterator;
import java.util.List;

public class Main {
    public static long[] toLongArray(List<Integer> list) {
        long[] array = new long[list.size()];
        Iterator<Integer> ints = list.iterator();
        int idx = 0;
        while (ints.hasNext()) {
            Integer value = ints.next();
            array[idx++] = value.intValue();
        }/*from www .ja  v  a  2s .  c o  m*/
        return array;
    }
}

Related

  1. toLong(List list)
  2. toLongArray(final List list)
  3. toLongArray(final List idList)
  4. toLongArray(List list)
  5. toLongArray(List list)
  6. toLongArray(List list)
  7. toLongArray(List list)