com.infoengine.SAK
Class WriterOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended bycom.infoengine.SAK.WriterOutputStream

public class WriterOutputStream
extends OutputStream

This class implements an output stream class that wraps a writer class. This makes it convenient to use a servlet or JSP writer as the output stream for a webject.


Field Summary
private  BufferedWriter writer
           
 
Constructor Summary
WriterOutputStream(Writer writer)
          Constructs an instance that wraps a specified writer.
 
Method Summary
 void close()
          Closes this output stream and releases any system resources associated with this stream.
 void flush()
          Flushes this output stream and forces any buffered output bytes to be written.
 void write(byte[] b)
          Writes b.length bytes from the specified byte array to this output stream.
 void write(byte[] b, int off, int len)
          Writes len bytes from the specified byte array starting at offset off to this output stream.
 void write(int b)
          Writes the specified byte to this output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

writer

private BufferedWriter writer
Constructor Detail

WriterOutputStream

public WriterOutputStream(Writer writer)
Constructs an instance that wraps a specified writer.

Parameters:
writer - The writer to be wrapped.
Method Detail

write

public void write(int b)
           throws IOException
Writes the specified byte to this output stream.

Parameters:
b - The byte to be written.
Throws:
IOException - if an I/O error occurs.

write

public void write(byte[] b)
           throws IOException
Writes b.length bytes from the specified byte array to this output stream.

Parameters:
b - The byte array to be written.
Throws:
IOException - if an I/O error occurs.

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Writes len bytes from the specified byte array starting at offset off to this output stream.

Parameters:
b - The byte array to be written.
off - The offset of the first byte to write.
len - The number of bytes to write.
Throws:
IOException - if an I/O error occurs.

flush

public void flush()
           throws IOException
Flushes this output stream and forces any buffered output bytes to be written.

Throws:
IOException - if an I/O error occurs.

close

public void close()
           throws IOException
Closes this output stream and releases any system resources associated with this stream.

Throws:
IOException - if an I/O error occurs.