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.
-
Constructor Summary
ConstructorsConstructorDescriptionBoundedServletInputStream(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
read, readAllBytes, readLine, readNBytes, readNBytesMethods inherited from class java.io.InputStream
nullInputStream, skipNBytes, transferTo
-
Constructor Details
-
BoundedServletInputStream
Wraps the specified byte array.- Parameters:
b- The byte contents of the stream.
-
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.
-
-
Method Details
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
isFinished
- Specified by:
isFinishedin classjakarta.servlet.ServletInputStream
-
isReady
- Specified by:
isReadyin classjakarta.servlet.ServletInputStream
-
mark
- Overrides:
markin classInputStream
-
markSupported
- Overrides:
markSupportedin classInputStream
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
setReadListener
- Specified by:
setReadListenerin classjakarta.servlet.ServletInputStream
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-