MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / appendStringContent

Method appendStringContent

java/src/org/openqa/selenium/json/Input.java:155–171  ·  view source on GitHub ↗

Consume characters that need no special handling within a JSON string, appending them to the supplied builder in bulk. Stops before the next '"', '\\', or control character, which is left unconsumed. @param sink StringBuilder that accumulates the string body @return the unconsumed special c

(StringBuilder sink)

Source from the content-addressed store, hash-verified

153 * is exhausted
154 */
155 public int appendStringContent(StringBuilder sink) {
156 while (fill()) {
157 int start = position + 1;
158 for (int i = start; i < filled; i++) {
159 char c = buffer[i];
160 if (c == '"' || c == '\\' || c < 0x20) {
161 sink.append(buffer, start, i - start);
162 position = i - 1;
163 return c;
164 }
165 }
166 sink.append(buffer, start, filled - start);
167 position = filled - 1;
168 }
169
170 return EOF;
171 }
172
173 /**
174 * Consume whitespace characters in bulk, leaving the first non-whitespace character unconsumed.

Callers 1

readStringMethod · 0.80

Calls 2

fillMethod · 0.95
appendMethod · 0.45

Tested by

no test coverage detected