nl.imsystems.atag.servlet
Class ByteArrayServletOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by javax.servlet.ServletOutputStream
          extended by nl.imsystems.atag.servlet.ByteArrayServletOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class ByteArrayServletOutputStream
extends ServletOutputStream

A ServletOutputStream implementation that buffers the bytes written to it in a ByteArrayOutputStream.

Author:
kayvan


Constructor Summary
ByteArrayServletOutputStream()
           
 
Method Summary
 byte[] getBytes()
          Returns the buffered bytes.
 void write(int value)
          Writes a byte to the buffer.
 
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

ByteArrayServletOutputStream

public ByteArrayServletOutputStream()
Method Detail

getBytes

public byte[] getBytes()
Returns the buffered bytes.

Returns:
the buffered bytes

write

public void write(int value)
           throws IOException
Writes a byte to the buffer.

Specified by:
write in class OutputStream
Throws:
IOException