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