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

Method exhaust

corpus/java/training/guava/io/CharStreams.java:161–171  ·  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

159 * @since 20.0
160 */
161 @CanIgnoreReturnValue
162 public static long exhaust(Readable readable) throws IOException {
163 long total = 0;
164 long read;
165 CharBuffer buf = createBuffer();
166 while ((read = readable.read(buf)) != -1) {
167 total += read;
168 buf.clear();
169 }
170 return total;
171 }
172
173 /**
174 * 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