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

Method countBySkipping

corpus/java/training/guava/io/ByteSource.java:223–230  ·  view source on GitHub ↗

Counts the bytes in the given input stream using skip if possible. Returns SKIP_FAILED if the first call to skip threw, in which case skip may just not be supported.

(InputStream in)

Source from the content-addressed store, hash-verified

221 * first call to skip threw, in which case skip may just not be supported.
222 */
223 private long countBySkipping(InputStream in) throws IOException {
224 long count = 0;
225 long skipped;
226 while ((skipped = skipUpTo(in, Integer.MAX_VALUE)) > 0) {
227 count += skipped;
228 }
229 return count;
230 }
231
232 /**
233 * Copies the contents of this byte source to the given {@code OutputStream}. Does not close

Callers 1

sizeMethod · 0.95

Calls 1

skipUpToMethod · 0.45

Tested by

no test coverage detected