org.springframework.mock.web
Class DelegatingServletOutputStream
java.lang.Object
ServletOutputStream
org.springframework.mock.web.DelegatingServletOutputStream
- Direct Known Subclasses:
- MockHttpServletResponse.ResponseServletOutputStream
public class DelegatingServletOutputStream
- extends ServletOutputStream
Delegating implementation of javax.servlet.ServletOutputStream
.
Used by MockHttpServletResponse
; typically not directly
used for testing application controllers.
- Since:
- 1.0.2
- Author:
- Juergen Hoeller
- See Also:
MockHttpServletResponse
Constructor Summary |
DelegatingServletOutputStream(java.io.OutputStream targetStream)
Create a DelegatingServletOutputStream for the given target stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
targetStream
private final java.io.OutputStream targetStream
DelegatingServletOutputStream
public DelegatingServletOutputStream(java.io.OutputStream targetStream)
- Create a DelegatingServletOutputStream for the given target stream.
- Parameters:
targetStream
- the target stream (never null
)
getTargetStream
public final java.io.OutputStream getTargetStream()
- Return the underlying target stream (never
null
).
write
public void write(int b)
throws java.io.IOException
- Throws:
java.io.IOException
flush
public void flush()
throws java.io.IOException
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Throws:
java.io.IOException