public class DisconnectableInputStream extends BulkReadInputStream
InputStream which reads from the source InputStream. In addition, when the InputStream is
closed, all threads blocked reading from the stream will receive an end-of-stream.| Constructor and Description |
|---|
DisconnectableInputStream(java.io.InputStream source,
ExecutorFactory executorFactory) |
DisconnectableInputStream(java.io.InputStream source,
ExecutorFactory executorFactory,
int bufferLength) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this
InputStream for reading. |
int |
read(byte[] bytes,
int pos,
int count) |
readpublic DisconnectableInputStream(java.io.InputStream source,
ExecutorFactory executorFactory)
public DisconnectableInputStream(java.io.InputStream source,
ExecutorFactory executorFactory,
int bufferLength)
public int read(byte[] bytes,
int pos,
int count)
throws java.io.IOException
read in class BulkReadInputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
InputStream for reading. Any threads blocked in read() will receive a AsynchronousCloseException. Also requests that the reader thread stop reading, if possible,
but does not block waiting for this to happen.
NOTE: this method does not close the source input stream.
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOExceptionCopyright © 2013. All rights reserved