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

Method limit

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

Wraps a InputStream, limiting the number of bytes which can be read. @param in the input stream to be wrapped @param limit the maximum number of bytes to be read @return a length-limited InputStream @since 14.0 (since 1.0 as com.google.common.io.LimitInputStream)

(InputStream in, long limit)

Source from the content-addressed store, hash-verified

634 * @since 14.0 (since 1.0 as com.google.common.io.LimitInputStream)
635 */
636 public static InputStream limit(InputStream in, long limit) {
637 return new LimitedInputStream(in, limit);
638 }
639
640 private static final class LimitedInputStream extends FilterInputStream {
641

Callers 4

sliceStreamMethod · 0.95
growMethod · 0.45
readMoreCharsMethod · 0.45
availableCapacityMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected