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)
| 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 { |
no outgoing calls
no test coverage detected