MCPcopy Create free account
hub / github.com/antlr/codebuff / exhaust

Method exhaust

output/java_guava/1.4.16/CharStreams.java:169–179  ·  view source on GitHub ↗

Reads and discards data from the given Readable until the end of the stream is reached. Returns the total number of chars read. Does not close the stream. @since 20.0

(Readable readable)

Source from the content-addressed store, hash-verified

167 */
168
169 @CanIgnoreReturnValue
170 public static long exhaust(Readable readable) throws IOException {
171 long total = 0;
172 long read;
173 CharBuffer buf = createBuffer();
174 while ((read = readable.read(buf)) != -1) {
175 total += read;
176 buf.clear();
177 }
178 return total;
179 }
180
181 /**
182 * Discards {@code n} characters of data from the reader. This method will block until the full

Callers

nothing calls this directly

Calls 3

createBufferMethod · 0.95
clearMethod · 0.65
readMethod · 0.45

Tested by

no test coverage detected