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
ConstructorsConstructorDescriptionLimitingInputStream(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:
 readin classInputStream- Throws:
 IOException
 - 
read
- Overrides:
 readin classInputStream- Throws:
 IOException
 - 
read
- Overrides:
 readin classInputStream- Throws:
 IOException
 - 
available
- Overrides:
 availablein classInputStream- Throws:
 IOException
 - 
close
- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfaceCloseable- Overrides:
 closein classInputStream- Throws:
 IOException
 
 -