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

Method exhaust

output/java_guava/1.4.17/ByteStreams.java:235–244  ·  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

233 */
234
235 @CanIgnoreReturnValue
236 public static long exhaust(InputStream in) throws IOException {
237 long total = 0;
238 long read;
239 byte[] buf = createBuffer();
240 while ((read = in.read(buf)) != -1) {
241 total += read;
242 }
243 return total;
244 }
245
246 /**
247 * 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