public static double[] readDoubleArray(JsonReaderEx reader) {
    checkIsNull(reader);
    reader.beginArray();
    if (!reader.hasNext()) {
      reader.endArray();
      return new double[0];
    }

    DoubleArrayList result = new DoubleArrayList();
    do {
      result.add(reader.nextDouble());
    }
    while (reader.hasNext());
    reader.endArray();
    return result.toDoubleArray();
  }
public static double[] readDoubleArray(JsonReaderEx reader)