Package org.springframework.mock.web
Class DelegatingServletOutputStream
java.lang.Object
java.io.OutputStream
jakarta.servlet.ServletOutputStream
org.springframework.mock.web.DelegatingServletOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Delegating implementation of
ServletOutputStream.
Used by MockHttpServletResponse; typically not directly
used for testing application controllers.
- Since:
- 1.0.2
- Author:
- Juergen Hoeller
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDelegatingServletOutputStream(OutputStream targetStream) Create a DelegatingServletOutputStream for the given target stream. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()final OutputStreamReturn the underlying target stream (nevernull).booleanisReady()voidsetWriteListener(WriteListener writeListener) voidwrite(int b) Methods inherited from class jakarta.servlet.ServletOutputStream
print, print, print, print, print, print, print, println, println, println, println, println, println, println, printlnMethods inherited from class java.io.OutputStream
nullOutputStream, write, write
-
Constructor Details
-
DelegatingServletOutputStream
Create a DelegatingServletOutputStream for the given target stream.- Parameters:
targetStream- the target stream (nevernull)
-
-
Method Details
-
getTargetStream
Return the underlying target stream (nevernull). -
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
isReady
public boolean isReady()- Specified by:
isReadyin classServletOutputStream
-
setWriteListener
- Specified by:
setWriteListenerin classServletOutputStream
-