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

Method skipSafely

output/java_guava/1.4.17/ByteStreams.java:829–832  ·  view source on GitHub ↗

Attempts to skip up to n bytes from the given input stream, but not more than in.available() bytes. This prevents FileInputStream from skipping more bytes than actually remain in the file, something that it plain FileInputStream#skip(long) specifies it can do in its Ja

(InputStream in, long n)

Source from the content-addressed store, hash-verified

827
828
829 private static long skipSafely(InputStream in, long n) throws IOException {
830 int available = in.available();
831 return available == 0 ? 0 : in.skip(Math.min(available, n));
832 }
833
834 /**
835 * Process the bytes of the given input stream using the given processor.

Callers 1

skipUpToMethod · 0.95

Calls 3

availableMethod · 0.45
skipMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected