Receiving long data using Serial

Turn on maximum compiler warnings in preferences. It will give you some warnings which boil down to an issue with this line:

  static byte ndx = 0;

ndx will need to be int now your buffer size exceeds 255