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

Method fill

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

If all buffered input has been consumed, read the next chunk into the buffer. NOTE : The last 128 character of consumed input is retained for debug output. @return true if new input is available; false if input is exhausted @throws UncheckedIOException if an I/O exception

()

Source from the content-addressed store, hash-verified

267 * @throws UncheckedIOException if an I/O exception is encountered
268 */
269 private boolean fill() {
270 if (source == null) {
271 // String-backed input is fully buffered on construction.
272 return filled > position + 1;
273 }
274
275 // do we need to fill the buffer?
276 while (filled == position + 1) {
277 try {
278 // free the buffer, keep only the chars to remember
279 int shift = filled - MEMORY_SIZE;
280 if (shift > 0) {
281 position -= shift;
282 filled -= shift;
283
284 System.arraycopy(buffer, shift, buffer, 0, filled);
285 }
286
287 // try to fill the buffer
288 int n = source.read(buffer, filled, buffer.length - filled);
289
290 if (n == -1) {
291 // EOF reached
292 return false;
293 } else {
294 // n might be 0, the outer loop will handle this
295 filled += n;
296 }
297 } catch (IOException e) {
298 throw new UncheckedIOException(e.getMessage(), e);
299 }
300 }
301
302 return true;
303 }
304}

Callers 9

peekMethod · 0.95
readMethod · 0.95
readSimpleStringMethod · 0.95
appendStringContentMethod · 0.95
skipWhitespaceMethod · 0.95
appendDigitsMethod · 0.95
build_tarFunction · 0.80
exceptionCaughtMethod · 0.80
wrappedFunction · 0.80

Calls 2

readMethod · 0.65
getMessageMethod · 0.45

Tested by 1

wrappedFunction · 0.64