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

Method fill

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

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

Callers 5

peekMethod · 0.95
readMethod · 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