class NumberArrayAdapter extends TypeAdapter<double[]> {

  @Override
  public double[] deserialize(byte[] buffer, int bufferPosition) {
    int cursor = bufferPosition;
    int length = Serialization.readInt(buffer, cursor);
    cursor += Serialization.SIZE_OF_INT;
    double[] doubleArray = new double[length];
    for (int i = 0; i < length; i++) {
      double val = Serialization.readDouble(buffer, cursor);
      doubleArray[i] = val;
      cursor += Serialization.SIZE_OF_DOUBLE;
    }
    return doubleArray;

  }

  public  NumberArrayAdapter();

}