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
ConstructorDescriptionDelegatingServletInputStream
(InputStream sourceStream) Create a DelegatingServletInputStream for the given source stream. -
Method Summary
Modifier and TypeMethodDescriptionint
void
close()
final InputStream
Return the underlying source stream (nevernull
).boolean
boolean
isReady()
int
read()
void
setReadListener
(ReadListener readListener) Methods inherited from class jakarta.servlet.ServletInputStream
readLine
Methods 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:
read
in classInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
isFinished
public boolean isFinished()- Specified by:
isFinished
in classServletInputStream
-
isReady
public boolean isReady()- Specified by:
isReady
in classServletInputStream
-
setReadListener
- Specified by:
setReadListener
in classServletInputStream
-