sk.uniba.euromath.tools.io
Class PipedExceptionInputStream
java.lang.Object
java.io.InputStream
java.io.PipedInputStream
sk.uniba.euromath.tools.io.PipedExceptionInputStream
- All Implemented Interfaces:
- Closeable
public final class PipedExceptionInputStream
- extends PipedInputStream
Functionally identical to PipedInputStream
, except that when an
exception is caught in the producer thread (the thread that writes data to
associated PipedOutputStream
) and it is registered in the
registry
then all read()
methods will fail with the
registered exception. For further details please see the documentation of
ExceptionRegistry
.
- Author:
- Martin Vysny
Method Summary |
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
registry
public final ExceptionRegistry registry
- If exception in producer occurs then record it here before thread
termination. It will then be linked as cause of exception thrown by all
read()
methods.
PipedExceptionInputStream
public PipedExceptionInputStream(PipedOutputStream src)
throws IOException
- Constructor.
- Parameters:
src
- source.
- Throws:
IOException
PipedExceptionInputStream
public PipedExceptionInputStream()
- Constructor.
read
public int read()
throws IOException
- Overrides:
read
in class PipedInputStream
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read
in class PipedInputStream
- Throws:
IOException
Copyright 2003-2003-2006 null. All Rights Reserved.