Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
1.5, 1.6.0
-
None
-
None
Description
The method getJSONString() in AbstractJSONDataSource makes
use of string concatenation instead of using a buffer (e.g. StringBuilder).
char temp = (char)jsonReader.read();
jsonString = "";
while ((int)temp != 65535)
A buffer would be nice for printing large JSON-strings (e.g. with 40000 characters)
or a printing a lot of middle-sized JSON-strings.
char temp = (char)jsonReader.read();
StringBuilder sb = new StringBuilder(100); // TODO which initial capacity?
while ((int)temp != 65535)
jsonString = sb.toString();