public final class TimeoutInputStream extends InputStream
InputStream wrapper that will timeout if read doesn't happen within specified time| Constructor and Description |
|---|
TimeoutInputStream(InputStream inputStream,
long timeout,
TimeUnit timeUnit)
default constuctor
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
read() |
available, mark, markSupported, read, read, reset, skippublic TimeoutInputStream(InputStream inputStream, long timeout, TimeUnit timeUnit)
inputStream - wrapped InputStreamtimeout - timeout valuetimeUnit - time unit value like millis or secondspublic int read()
throws IOException
read in class InputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionCopyright © 2022. All rights reserved.