MCPcopy Index your code
hub / github.com/antlr/codebuff / exhaust

Method exhaust

corpus/java/training/guava/io/ByteStreams.java:227–236  ·  view source on GitHub ↗

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

(InputStream in)

Source from the content-addressed store, hash-verified

225 * @since 20.0
226 */
227 @CanIgnoreReturnValue
228 public static long exhaust(InputStream in) throws IOException {
229 long total = 0;
230 long read;
231 byte[] buf = createBuffer();
232 while ((read = in.read(buf)) != -1) {
233 total += read;
234 }
235 return total;
236 }
237
238 /**
239 * Returns a new {@link ByteArrayDataInput} instance to read from the {@code bytes} array from the

Callers 1

sizeMethod · 0.95

Calls 2

createBufferMethod · 0.95
readMethod · 0.45

Tested by

no test coverage detected