Package org.apache.juneau.rest.util
Class BoundedServletInputStream
java.lang.Object
java.io.InputStream
jakarta.servlet.ServletInputStream
org.apache.juneau.rest.util.BoundedServletInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
ServletInputStream wrapper around a normal input stream with support for limiting input.
See Also:
-
Constructor Summary
ConstructorDescriptionBoundedServletInputStream
(byte[] b) Wraps the specified byte array.BoundedServletInputStream
(jakarta.servlet.ServletInputStream sis, long max) Wraps the specified input stream.BoundedServletInputStream
(InputStream is, long max) Wraps the specified input stream. -
Method Summary
Methods inherited from class jakarta.servlet.ServletInputStream
readLine
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
BoundedServletInputStream
Wraps the specified input stream.- Parameters:
is
- The input stream to wrap.max
- The maximum number of bytes to read from the stream.
-
BoundedServletInputStream
Wraps the specified input stream.- Parameters:
sis
- The input stream to wrap.max
- The maximum number of bytes to read from the stream.
-
BoundedServletInputStream
Wraps the specified byte array.- Parameters:
b
- The byte contents of the stream.
-
-
Method Details
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
reset
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
mark
- Overrides:
mark
in classInputStream
-
markSupported
- Overrides:
markSupported
in classInputStream
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
isFinished
- Specified by:
isFinished
in classjakarta.servlet.ServletInputStream
-
isReady
- Specified by:
isReady
in classjakarta.servlet.ServletInputStream
-
setReadListener
- Specified by:
setReadListener
in classjakarta.servlet.ServletInputStream
-