调整数组大小
//package com.book2s; /* from NowJava.com - 时代Java */ import java.lang.reflect.Array; public class Main { public static <T> T[] resize(T[] buffer, int newSize, Class<?> componentType) { T[] newArray = newArray(componentType, newSize); System.arraycopy(buffer, 0, newArray, 0, buffer.length >= newSize ? newSize : buffer.length); return newArray; } /* 来 自* n o w j a v a . c o m - 时代Java */ public static <T> T[] resize(T[] buffer, int newSize) { return resize(buffer, newSize, buffer.getClass().getComponentType()); } @SuppressWarnings("unchecked") public static <