|
UC Berkeley Group for User Interface Research Updated November 17, 2000 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--edu.berkeley.guir.lib.io.Pipe
Creates a one-way pipe between an arbitrary InputStream and an OutputStream, forwarding anything in the InputStream into the OutputStream. Anything available in this InputStream will be automatically fed into the OutputStream.
The Pipe will call the PipeCallback object (if provided) when either end of the Pipe is closed.
The Pipe will filter the bytes appropriately if provided a Filter object.
You provide Provided You provide InputStream -> Pipe -> OutputStream
This software is distributed under the Berkeley Software License.
Revisions: - GUIRLib-v1.0-1.0.0, Jun 16 1998, JH Created class - GUIRLib-v1.2-1.0.0, Jun 22 2000, JH Touched for GUIRLib release - GUIRLib-v1.3-1.0.0, Aug 11 2000, JH Touched for GUIRLib release - GUIRLib-v1.4-1.0.0, Aug 31 2000, JH Touched for GUIRLib release
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
Pipe(InputStream istream,
OutputStream ostream)
Create a Pipe between the specified InputStream and OutputStream. |
|
Pipe(InputStream istream,
OutputStream ostream,
PipeCallback cb)
Create a Pipe between the specified InputStream and OutputStream. |
Method Summary | |
void |
close()
Close the pipe. |
long |
getNumberOfBytesTransferred()
Return the number of bytes transferred by the pipe. |
static void |
main(String[] argv)
|
void |
run()
|
void |
setCallback(PipeCallback cb)
Sets the pipe callback, which is called when the pipe closes. |
void |
setFilter(Filter f)
Set the filter inside of this Pipe. |
void |
setInputStream(InputStream istream)
Set where we get our input from. |
void |
setOutputStream(OutputStream ostream)
Set where we send our output to. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Pipe(InputStream istream, OutputStream ostream)
istream
- is the where we get input from.ostream
- is the where we send output to.public Pipe(InputStream istream, OutputStream ostream, PipeCallback cb)
istream
- is the where we get input from.ostream
- is the where we send output to.cb
- is the callback, called when the pipe closes.Method Detail |
public void run()
run
in class Thread
public void setCallback(PipeCallback cb)
cb
- is the callback. Use null for no callback.public void setOutputStream(OutputStream ostream)
ostream
- is the where we send output to.public void setInputStream(InputStream istream)
istream
- is the where we get input from.public void close()
public void setFilter(Filter f)
f
- is the filter. A null value means do not filter at all.public long getNumberOfBytesTransferred()
public static void main(String[] argv) throws Exception
|
Copyright Information | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |