String object getting cut off.

In my project I'm grabbing some data from a CC3000 and I'm storing it to a string. For some reason, only a part of the text being sent is being saved to the string. Does anybody know why? Is there a limit to the String object?

   /* Read data until either the connection is closed, or the idle timeout is reached. */ 
  while (www.connected() ) {
    while (www.available()) {
      char c = www.read();
      //Serial.print(c);

      input =  String(input + c);
    }
  }
  www.close();
  Serial.println();
 // Serial.println(textTwo);
  Serial.println(input);
  Serial.println(F("-------------------------------------"));

Also, while I'm already asking a question, what is a good way to parse XML or Json?

Thanks!

It's not a good idea to use the String class on arduino, because the memory requirements are very high.

The reason you seem to be losing the end of your messages, is not because it won't fit into the String object.

The probable reason, is that your while.. available construct is detecting the end of the string too early.

Serial characters arrive quite slowly, compared to the rate at which your loop() function and while loop
are rushing around. If you read, say, seven characters and add them to your string, and then consider, are
any more characters available ? If the UART is still halfway through reading in the eighth character, one bit
at a time, then the answer will be no, your while loop will exit, and you will print the incomplete message.