org.apache.shale.test.mock
Class MockServletOutputStream

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

public class MockServletOutputStream
extends ServletOutputStream

Mock implementation of ServletOutputStream.

$Id: MockServletOutputStream.java 464373 2006-10-16 04:21:54Z rahul $


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 © 2004-2007 Apache Software Foundation. All Rights Reserved.