Package org.biojava.utils.process
Class ReaderWriterPipe
- java.lang.Object
-
- org.biojava.utils.process.ReaderWriterPipe
-
- All Implemented Interfaces:
java.lang.Runnable
- Direct Known Subclasses:
ReaderInputHandler
,WriterOutputHandler
public class ReaderWriterPipe extends java.lang.Object implements java.lang.Runnable
A multi threaded class which pipes the contents of an input reader to an output writer.- Version:
- $Revision: 3634 $
- Author:
- Martin Szugat
-
-
Constructor Summary
Constructors Constructor Description ReaderWriterPipe(java.io.Reader reader, java.io.Writer writer, java.lang.String tag)
Initializes the reader writer pipe.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.Reader
getReader()
Gets the reader.java.io.Writer
getWriter()
Gets the writer.void
run()
void
setReader(java.io.Reader reader)
Sets the reader.void
setWriter(java.io.Writer writer)
Sets the writer.
-
-
-
Constructor Detail
-
ReaderWriterPipe
public ReaderWriterPipe(java.io.Reader reader, java.io.Writer writer, java.lang.String tag)
Initializes the reader writer pipe.- Parameters:
reader
- the reader from which to read. May benull
.writer
- the writer to which to write. May benull
.tag
- a tag for loggging. May benull
.
-
-
Method Detail
-
getReader
public java.io.Reader getReader()
Gets the reader.- Returns:
- the reader from which to read. May be
null
.
-
getWriter
public java.io.Writer getWriter()
Gets the writer.- Returns:
- the writer to which to write. May be
null
.
-
setReader
public void setReader(java.io.Reader reader)
Sets the reader.- Parameters:
reader
- the reader from which to read. May benull
.
-
setWriter
public void setWriter(java.io.Writer writer)
Sets the writer.- Parameters:
writer
- the writer to which to write. May benull
.
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
-