Package org.springframework.mock.web
Class DelegatingServletInputStream
java.lang.Object
java.io.InputStream
jakarta.servlet.ServletInputStream
org.springframework.mock.web.DelegatingServletInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
Delegating implementation of
ServletInputStream.
Used by MockHttpServletRequest; typically not directly
used for testing application controllers.
- Since:
- 1.0.2
- Author:
- Juergen Hoeller
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDelegatingServletInputStream(InputStream sourceStream) Create a DelegatingServletInputStream for the given source stream. -
Method Summary
Modifier and TypeMethodDescriptionintvoidclose()final InputStreamReturn the underlying source stream (nevernull).booleanbooleanisReady()intread()voidsetReadListener(ReadListener readListener) Methods inherited from class jakarta.servlet.ServletInputStream
readLineMethods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
DelegatingServletInputStream
Create a DelegatingServletInputStream for the given source stream.- Parameters:
sourceStream- the source stream (nevernull)
-
-
Method Details
-
getSourceStream
Return the underlying source stream (nevernull). -
read
- Specified by:
readin classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
isFinished
public boolean isFinished()- Specified by:
isFinishedin classServletInputStream
-
isReady
public boolean isReady()- Specified by:
isReadyin classServletInputStream
-
setReadListener
- Specified by:
setReadListenerin classServletInputStream
-