public class MockServletOutputStream
extends javax.servlet.ServletOutputStream
Mock implementation of ServletOutputStream.
| Constructor and Description |
|---|
MockServletOutputStream(ByteArrayOutputStream stream)
Return a default instance.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
content()
Return the content that has been written to this output stream.
|
void |
reset()
Reset this output stream so that it appears no content has been
written.
|
int |
size()
Return the number of bytes that have been written to this output stream.
|
void |
write(int content)
Write the specified content to our internal cache.
|
print, print, print, print, print, print, print, println, println, println, println, println, println, println, printlnclose, flush, write, writepublic MockServletOutputStream(ByteArrayOutputStream stream)
Return a default instance.
stream - The stream we will use to buffer outputpublic byte[] content()
Return the content that has been written to this output stream.
public void reset()
Reset this output stream so that it appears no content has been written.
public int size()
Return the number of bytes that have been written to this output stream.
public void write(int content)
Write the specified content to our internal cache.
write in class OutputStreamcontent - Content to be writtenCopyright © 2017 The Apache Software Foundation. All rights reserved.