de.j4ee.webloader.net
Class ListenerStream
java.lang.Object
java.io.OutputStream
de.j4ee.webloader.net.ListenerStream
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable
- Direct Known Subclasses:
- LineBasedListenerStream
public class ListenerStream
- extends java.io.OutputStream
This class can be used for read data in streaming mode, e.g.:
ListenerStream stream = new ListenerStream();
stream.addListener(stream.new StreamListener(){});
...
nw.outputStream = stream;
...
There is no Warranty
- Author:
- Kristian Martin
Methods inherited from class java.io.OutputStream |
write, write |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ListenerStream
public ListenerStream()
write
public void write(int b)
throws java.io.IOException
- Specified by:
write
in class java.io.OutputStream
- Throws:
java.io.IOException
flush
public void flush()
throws java.io.IOException
- Specified by:
flush
in interface java.io.Flushable
- Overrides:
flush
in class java.io.OutputStream
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Specified by:
close
in interface java.io.Closeable
- Overrides:
close
in class java.io.OutputStream
- Throws:
java.io.IOException
addListener
public void addListener(ListenerStream.StreamListener listener)