public static double[] expandArrayD(int bufferSize,double[] currentArray){
  if (currentArray == null) {
    return new double[bufferSize * 3];
  }
  int length=currentArray.length;
  double[] ret=new double[length + bufferSize * 3];
  System.arraycopy(currentArray,0,ret,0,length);
  return ret;
}

public static double [ ] expandArrayD ( int bufferSize , double [ ] currentArray ) { if ( currentArray == null ) { return new double [ bufferSize * 3 ] ; } int length = currentArray . length ; double [ ] ret = new double [ length + bufferSize * 3 ] ; System . arraycopy ( currentArray , 0 , ret , 0 , length ) ; return ret ; }
create an array to hold double data for 3d polygons and lines .
