Class BoundedInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.springframework.ws.support.BoundedInputStream
- All Implemented Interfaces:
Closeable, AutoCloseable
An
InputStream wrapper that limits the number of bytes read from an underlying
stream.
If the number of bytes read exceeds the specified max size, an IOException is
thrown.
- Since:
- 3.1.10
-
Field Summary
Fields inherited from class FilterInputStream
in -
Constructor Summary
ConstructorsConstructorDescriptionBoundedInputStream(InputStream in, org.springframework.util.unit.DataSize maxSize) Create a new instance. -
Method Summary
Methods inherited from class FilterInputStream
available, close, mark, markSupported, read, resetMethods inherited from class InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
BoundedInputStream
Create a new instance.- Parameters:
in- the input stream to handlemaxSize- the maximum allowed size (must be positive)
-
-
Method Details
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classFilterInputStream- Throws:
IOException
-