| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.io.OutputStream
rabbit.io.MultiOutputStream
A class to handle automatic writing to several streams simultanius.
| Field Summary | |
| static int | CLOSE_CURRENThow should exceptions be handled? by closing the stream causing it | 
| static int | RESPAWN_EXCEPTIONOr by respawning the exception up | 
| Constructor Summary | |
| MultiOutputStream()Creates a new MultiOutputStream with no connected OutputStreams | |
| MultiOutputStream(java.io.OutputStream os)Creates a new MultiOutputStream with one connected OutputStream | |
| Method Summary | |
|  void | addOutputStream(java.io.OutputStream os)Connects one more OutputStream. | 
|  void | close()Close this stream. | 
|  void | flush()Write any pending data. | 
| static void | main(java.lang.String[] args)Simple self test | 
|  void | removeOutputStream(java.io.OutputStream os)Disconnects one of the underlaying streams. | 
|  void | setMode(int i)Sets the mode of this stream. | 
|  void | write(byte[] b)Write a byte array to this stream. | 
|  void | write(byte[] b,
      int off,
      int len)Write a byte array to this stream. | 
|  void | write(int b)Write a byte to this stream. | 
|  void | writeHTTPHeader(HTTPHeader header)Write a HTTPHeader on this stream. | 
| Methods inherited from class java.lang.Object | 
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
public static final int CLOSE_CURRENT
public static final int RESPAWN_EXCEPTION
| Constructor Detail | 
public MultiOutputStream()
public MultiOutputStream(java.io.OutputStream os)
os - the OutputStream to connect to| Method Detail | 
public void addOutputStream(java.io.OutputStream os)
os - the new stream to connectpublic void removeOutputStream(java.io.OutputStream os)
os - the stream to disconnect.public void setMode(int i)
i - one of CLOSE_CURRENT(normal) and RESPAWN_EXCEPTION.
public void write(int b)
           throws java.io.IOException
b - the byte to write.
java.io.IOException - if the underlying stream does.
public void write(byte[] b)
           throws java.io.IOException
b - the byte array to write.
java.io.IOException - if the underlying stream does.
public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
b - the byte to write.off - the starting offset.len - the number of bytes to write.
java.io.IOException - if the underlying stream does.
public void writeHTTPHeader(HTTPHeader header)
                     throws java.io.IOException
header - the HTTPHeader to write.
java.io.IOException - if the header could not be written correctly.
public void flush()
           throws java.io.IOException
java.io.IOException - if the underlying stream does.
public void close()
           throws java.io.IOException
java.io.IOException - if the underlying stream does.public static void main(java.lang.String[] args)
| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||