MCPcopy
hub / github.com/google/guava / exhaust

Method exhaust

guava/src/com/google/common/io/ByteStreams.java:289–298  ·  view source on GitHub ↗

Reads and discards data from the given {@code 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

287 * @since 20.0
288 */
289 @CanIgnoreReturnValue
290 public static long exhaust(InputStream in) throws IOException {
291 long total = 0;
292 long read;
293 byte[] buf = createBuffer();
294 while ((read = in.read(buf)) != -1) {
295 total += read;
296 }
297 return total;
298 }
299
300 /**
301 * Returns a new {@link ByteArrayDataInput} instance to read from the {@code bytes} array from the

Callers 3

sizeMethod · 0.95
assertFailsToDecodeMethod · 0.95
testExhaustMethod · 0.95

Calls 2

createBufferMethod · 0.95
readMethod · 0.45

Tested by

no test coverage detected