MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / fill

Method fill

java/src/org/openqa/selenium/json/Input.java:124–153  ·  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

122 * @throws UncheckedIOException if an I/O exception is encountered
123 */
124 private boolean fill() {
125 // do we need to fill the buffer?
126 while (filled == position + 1) {
127 try {
128 // free the buffer, keep only the chars to remember
129 int shift = filled - MEMORY_SIZE;
130 if (shift > 0) {
131 position -= shift;
132 filled -= shift;
133
134 System.arraycopy(buffer, shift, buffer, 0, filled);
135 }
136
137 // try to fill the buffer
138 int n = source.read(buffer, filled, buffer.length - filled);
139
140 if (n == -1) {
141 // EOF reached
142 return false;
143 } else {
144 // n might be 0, the outer loop will handle this
145 filled += n;
146 }
147 } catch (IOException e) {
148 throw new UncheckedIOException(e.getMessage(), e);
149 }
150 }
151
152 return true;
153 }
154}

Callers 4

peekMethod · 0.95
readMethod · 0.95
exceptionCaughtMethod · 0.80
wrappedFunction · 0.80

Calls 2

readMethod · 0.65
getMessageMethod · 0.45

Tested by 1

wrappedFunction · 0.64