Convert from an array of one kind to an array of another kind. @param type @param src @return
(Class<T> type, S[] src)
| 252 | * @return |
| 253 | */ |
| 254 | public static <T,S> T[] toArray(Class<T> type, S[] src) { |
| 255 | @SuppressWarnings("unchecked") |
| 256 | T[] dest = (T[]) Array.newInstance(type, src.length); |
| 257 | System.arraycopy(src, 0, dest, 0, src.length); |
| 258 | return dest; |
| 259 | } |
| 260 | |
| 261 | /** |
| 262 | * Convert from an array of one kind to an array of another kind. |