Package org.springframework.mock.web
Class DelegatingServletOutputStream
- java.lang.Object
 - java.io.OutputStream
 - javax.servlet.ServletOutputStream
 - org.springframework.mock.web.DelegatingServletOutputStream
 
- All Implemented Interfaces:
 Closeable,Flushable,AutoCloseable
public class DelegatingServletOutputStream extends ServletOutputStream
Delegating implementation ofServletOutputStream.Used by
MockHttpServletResponse; typically not directly used for testing application controllers.- Since:
 - 1.0.2
 - Author:
 - Juergen Hoeller
 - See Also:
 MockHttpServletResponse
Constructor Summary
Constructors Constructor Description DelegatingServletOutputStream(OutputStream targetStream)Create a DelegatingServletOutputStream for the given target stream.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()OutputStreamgetTargetStream()Return the underlying target stream (nevernull).voidwrite(int b)Methods inherited from class javax.servlet.ServletOutputStream
isReady, print, print, print, print, print, print, print, println, println, println, println, println, println, println, println, setWriteListener
Methods inherited from class java.io.OutputStream
nullOutputStream, write, write
Constructor Detail
DelegatingServletOutputStream
public DelegatingServletOutputStream(OutputStream targetStream)
Create a DelegatingServletOutputStream for the given target stream.- Parameters:
 targetStream- the target stream (nevernull)
Method Detail
getTargetStream
public final OutputStream getTargetStream()
Return the underlying target stream (nevernull).
write
public void write(int b) throws IOException
- Specified by:
 writein classOutputStream- Throws:
 IOException
flush
public void flush() throws IOException
- Specified by:
 flushin interfaceFlushable- Overrides:
 flushin classOutputStream- Throws:
 IOException
close
public void close() throws IOException
- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfaceCloseable- Overrides:
 closein classOutputStream- Throws:
 IOException