|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.unkrig.commons.io.pipe.PipeUtil
public final class PipeUtil
Utility methods related to the Pipe interface.
| Nested Class Summary | |
|---|---|
static interface |
PipeUtil.Drainer
Drains 'something' by reading data from an input stream. |
static interface |
PipeUtil.Filler
Fills 'something' by writing data to an output stream. |
static interface |
PipeUtil.FillerAndDrainer
|
static interface |
PipeUtil.InputOutputStreams
A tuple of one InputStream and one OutputStream. |
| Method Summary | |
|---|---|
static PipeUtil.InputOutputStreams |
asInputOutputStreams(Pipe pipe)
Creates and returns a pair of output stream and input stream which write to and read from the given pipe. |
static Pipe |
deleteFileOnClose(Pipe delegate,
java.io.File file)
|
static Pipe |
onClose(Pipe delegate,
RunnableWhichThrows<java.io.IOException> runnable)
|
static void |
temporaryStorage(PipeUtil.FillerAndDrainer fillerAndDrainer)
Convenience method for temporaryStorage(Filler, Drainer) when the filler wants to pass information to
the drainer. |
static void |
temporaryStorage(PipeUtil.Filler filler,
PipeUtil.Drainer drainer)
Creates a temporary PipeFactory.elasticPipe(), invokes the filler (which fills the pipe), then
invokes the drainer (which drains the pipe), and eventually closes the pipe. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static PipeUtil.InputOutputStreams asInputOutputStreams(Pipe pipe)
pipe. The streams block the calling thread while the pipe is full resp. empty.
Closing the output stream indicates an end-of-input condition to the input stream.
Closing the input stream closes the pipe, and the next write attempt to the output stream will cause an
EOFException.
public static Pipe deleteFileOnClose(Pipe delegate,
java.io.File file)
delegate, and, in addition, deletes the
given file on Pipe.close()
public static Pipe onClose(Pipe delegate,
RunnableWhichThrows<java.io.IOException> runnable)
delegate, and, in addition, runs the given
runnable on Pipe.close() AFTER having closed the delegate
public static void temporaryStorage(PipeUtil.FillerAndDrainer fillerAndDrainer)
throws java.io.IOException
temporaryStorage(Filler, Drainer) when the filler wants to pass information to
the drainer.
java.io.IOException
public static void temporaryStorage(PipeUtil.Filler filler,
PipeUtil.Drainer drainer)
throws java.io.IOException
PipeFactory.elasticPipe(), invokes the filler (which fills the pipe), then
invokes the drainer (which drains the pipe), and eventually closes the pipe.
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||