org.jppf.utils.streams
Class NotifyingInputStream
java.lang.Object
java.io.InputStream
org.jppf.utils.streams.NotifyingInputStream
- All Implemented Interfaces:
- Closeable
public class NotifyingInputStream
- extends InputStream
Input stream that delegates read aand skip operations to an underlying stream,
and sends notifications of how many bytes were read or skipped via a callback.
- Author:
- Laurent Cohen
- See Also:
NotifyingStreamCallback,
NotifyingOutputStream
|
Method Summary |
void |
close()
|
int |
read()
|
int |
read(byte[] b)
|
int |
read(byte[] b,
int off,
int len)
|
long |
skip(long n)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NotifyingInputStream
public NotifyingInputStream(InputStream delegate,
NotifyingStreamCallback callback)
- Initialize this stream with the specified input stream.
- Parameters:
delegate - the input stream to which operations are delegated.callback - the callback to notify of stream operations.
read
public int read()
throws IOException
-
- Specified by:
read in class InputStream
- Throws:
IOException
read
public int read(byte[] b)
throws IOException
-
- Overrides:
read in class InputStream
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
-
- Overrides:
read in class InputStream
- Throws:
IOException
skip
public long skip(long n)
throws IOException
-
- Overrides:
skip in class InputStream
- Throws:
IOException
close
public void close()
throws IOException
-
- Specified by:
close in interface Closeable- Overrides:
close in class InputStream
- Throws:
IOException
Copyright © 2005-2010 JPPF Team.