java.lang.Object
java.io.InputStream
org.refcodes.io.BlockingInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
The
BlockingInputStream wraps an InputStream adding blocking
functionality, e.g. when trying to read, the read operation is blocked till
available() returns a value greater than 0. Use a
AvailableInputStream to combine the BlockingInputStream with
a timeout.-
Constructor Summary
ConstructorsConstructorDescriptionBlockingInputStream(InputStream aInputStream) Decorates the providedInputStreamblocking functionality -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, readNBytes, skip, skipNBytes, transferTo
-
Constructor Details
-
BlockingInputStream
Decorates the providedInputStreamblocking functionality- Parameters:
aInputStream- TheInputStreamto be decorated accordingly.
-
-
Method Details
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
readAllBytes
- Overrides:
readAllBytesin classInputStream- Throws:
IOException
-
readNBytes
- Overrides:
readNBytesin classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
markin classInputStream
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-