Ensure TimeoutInputStreams are closed.

This commit is contained in:
akwizgran
2020-08-13 16:21:46 +01:00
parent 0e2d905486
commit 79ad5ca07e
3 changed files with 6 additions and 0 deletions

View File

@@ -7,6 +7,10 @@ public interface TimeoutMonitor {
/**
* Returns an {@link InputStream} that wraps the given stream and allows
* read timeouts to be detected.
* <p>
* The returned stream must be {@link InputStream#close() closed} when it's
* no longer needed to ensure that resources held by the timeout monitor
* are released.
*
* @param timeoutMs The read timeout in milliseconds. Timeouts will be
* detected eventually but are not guaranteed to be detected immediately.