- /**
- * Get the next token or string. This is used in parsing HTTP headers.
- * @throws JSONException
- * @return A String.
- */
- public String nextToken() throws JSONException {
- char c;
- char q;
- StringBuilder sb = new StringBuilder();
- do {
- c = next();
- } while (Character.isWhitespace(c));
- if (c == '"' || c == '\'') {
- q = c;
- for (;;) {
- c = next();
- if (c < ' ') {
- throw syntaxError("Unterminated string.");
- }
- if (c == q) {
- return sb.toString();
- }
- sb.append(c);
- }
+ /**
+ * Get the next token or string. This is used in parsing HTTP headers.
+ *
+ * @throws JSONException
+ * @return A String.
+ */
+ public String nextToken() throws JSONException
+ {
+ char c;
+ char q;
+ StringBuilder sb = new StringBuilder();
+ do
+ {
+ c = next();
+ } while (Character.isWhitespace(c));
+ if (c == '"' || c == '\'')
+ {
+ q = c;
+ for (;;)
+ {
+ c = next();
+ if (c < ' ')
+ {
+ throw syntaxError("Unterminated string.");