public class PollingInputStream extends FilterInputStream
in| Constructor and Description |
|---|
PollingInputStream(InputStream in,
int numAttempts,
org.eclipse.core.runtime.IProgressMonitor monitor)
Creates a new polling input stream.
|
PollingInputStream(InputStream in,
int numAttempts,
org.eclipse.core.runtime.IProgressMonitor monitor,
String readTimeoutMessage,
String closeTimeoutMessage)
Creates a new polling input stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Wraps the underlying stream's method.
|
int |
read()
Wraps the underlying stream's method.
|
int |
read(byte[] buffer,
int off,
int len)
Wraps the underlying stream's method.
|
protected void |
readPendingInput()
Reads any pending input from the input stream so that the stream can
savely be closed.
|
void |
setIsCancellable(boolean cancellable)
Called to set whether cancellation will be checked by this stream.
|
long |
skip(long count)
Wraps the underlying stream's method.
|
available, mark, markSupported, read, resetpublic PollingInputStream(InputStream in, int numAttempts, org.eclipse.core.runtime.IProgressMonitor monitor)
in - the underlying input streamnumAttempts - the number of attempts before issuing an
InterruptedIOException, if 0, retries indefinitely until
canceledmonitor - the progress monitor to be polled for cancellationpublic PollingInputStream(InputStream in, int numAttempts, org.eclipse.core.runtime.IProgressMonitor monitor, String readTimeoutMessage, String closeTimeoutMessage)
in - the underlying input streamnumAttempts - the number of attempts before issuing an
InterruptedIOException, if 0, retries indefinitely until
canceledmonitor - the progress monitor to be polled for cancellationreadTimeoutMessage - message to go with InteruptedIOException if read timeoutcloseTimeoutMessage - message to go with InteruptedIOException if close timeoutpublic void close()
throws InterruptedIOException
close in interface Closeableclose in interface AutoCloseableclose in class FilterInputStreamorg.eclipse.core.runtime.OperationCanceledException - if the progress monitor is canceledInterruptedIOException - if the underlying operation times out numAttempts timespublic int read()
throws IOException
read in class FilterInputStreamorg.eclipse.core.runtime.OperationCanceledException - if the progress monitor is canceledInterruptedIOException - if the underlying operation times out numAttempts times and
no data was received, bytesTransferred will be zeroIOException - if an i/o error occurspublic int read(byte[] buffer,
int off,
int len)
throws IOException
read in class FilterInputStreambuffer - - the buffer into which the data is read.off - - the start offset of the data.len - - the maximum number of bytes read.org.eclipse.core.runtime.OperationCanceledException - if the progress monitor is canceledInterruptedIOException - if the underlying operation times out numAttempts times and
no data was received, bytesTransferred will be zeroIOException - if an i/o error occurspublic long skip(long count)
throws IOException
skip in class FilterInputStreamcount - - the number of bytes to be skipped.org.eclipse.core.runtime.OperationCanceledException - if the progress monitor is canceledInterruptedIOException - if the underlying operation times out numAttempts times and
no data was received, bytesTransferred will be zeroIOException - if an i/o error occursprotected void readPendingInput()
throws IOException
IOException - if some problem readingpublic void setIsCancellable(boolean cancellable)
cancellable - a flag controlling whether this stream will check for
cancellation.Copyright © 2004–2020 Eclipse Foundation. All rights reserved.