public class ExceptionPassingPipedInputStream extends PipedInputStream
PipedInputStream
/ PipedOutputStream
pair allows to pass on exceptions from the input to the output end.ExceptionPassingPipedInputStream
buffer, in, out, PIPE_SIZE
Constructor and Description |
---|
ExceptionPassingPipedInputStream() |
ExceptionPassingPipedInputStream(ExceptionPassingPipedOutputStream src) |
Modifier and Type | Method and Description |
---|---|
void |
connect(PipedOutputStream source)
Connects this stream with a matching
ExceptionPassingPipedOutputStream . |
void |
done() |
void |
passOnException(Throwable e)
Pass the given exception to the connected output stream, and subsequently close this stream.
|
mark, markSupported, read, reset, skip
public ExceptionPassingPipedInputStream()
public ExceptionPassingPipedInputStream(ExceptionPassingPipedOutputStream src) throws IOException
IOException
public void connect(PipedOutputStream source) throws IOException, IllegalArgumentException
ExceptionPassingPipedOutputStream
. If you pass in something else,
an IllegalArgumentException
is thrown.connect
in class PipedInputStream
IllegalArgumentException
- when passing in something that is not an
ExceptionPassingPipedOutputStream
IOException
PipedInputStream.connect(java.io.PipedOutputStream)
public void passOnException(Throwable e)
e
- must be either an IOException
or a
RuntimeException
public void done()