Package io.micronaut.http.poja.util
Class LimitingInputStream
java.lang.Object
java.io.InputStream
io.micronaut.http.poja.util.LimitingInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
A wrapper around input stream that limits the maximum size to be read.
-
Constructor Summary
ConstructorDescriptionLimitingInputStream
(InputStream stream, long maxSize) Create the limiting input stream. -
Method Summary
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
LimitingInputStream
Create the limiting input stream.- Parameters:
stream
- The delegate streammaxSize
- The maximum size to read
-
-
Method Details
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-