org.apache.myfaces.test.mock
Class MockServletOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by javax.servlet.ServletOutputStream
          extended by org.apache.myfaces.test.mock.MockServletOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class MockServletOutputStream
extends javax.servlet.ServletOutputStream

Mock implementation of ServletOutputStream.

$Id: MockServletOutputStream.java 990408 2010-08-28 18:59:21Z lu4242 $

Since:
1.0.0

Constructor Summary
MockServletOutputStream(ByteArrayOutputStream stream)
          Return a default instance.
 
Method Summary
 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.
 
Methods inherited from class javax.servlet.ServletOutputStream
print, print, print, print, print, print, print, println, println, println, println, println, println, println, println
 
Methods inherited from class java.io.OutputStream
close, flush, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockServletOutputStream

public MockServletOutputStream(ByteArrayOutputStream stream)

Return a default instance.

Parameters:
stream - The stream we will use to buffer output
Method Detail

content

public byte[] content()

Return the content that has been written to this output stream.


reset

public void reset()

Reset this output stream so that it appears no content has been written.


size

public int size()

Return the number of bytes that have been written to this output stream.


write

public void write(int content)

Write the specified content to our internal cache.

Specified by:
write in class OutputStream
Parameters:
content - Content to be written


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.