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

Method limit

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

Wraps a {@link 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 {@link 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

705 * @since 14.0 (since 1.0 as com.google.common.io.LimitInputStream)
706 */
707 @J2ktIncompatible
708 public static InputStream limit(InputStream in, long limit) {
709 return new LimitedInputStream(in, limit);
710 }
711
712 @J2ktIncompatible
713 private static final class LimitedInputStream extends FilterInputStream {

Callers 9

sliceStreamMethod · 0.95
testLimitMethod · 0.95
testLimit_markMethod · 0.95
testLimit_skipMethod · 0.95
testLimit_markNotSetMethod · 0.95
growMethod · 0.45
readMoreCharsMethod · 0.45
availableCapacityMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected