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
ConstructorDescriptionBlockingInputStream
(InputStream aInputStream) Decorates the providedInputStream
blocking functionality -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, readNBytes, skip, skipNBytes, transferTo
-
Constructor Details
-
BlockingInputStream
Decorates the providedInputStream
blocking functionality- Parameters:
aInputStream
- TheInputStream
to be decorated accordingly.
-
-
Method Details
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
readAllBytes
- Overrides:
readAllBytes
in classInputStream
- Throws:
IOException
-
readNBytes
- Overrides:
readNBytes
in classInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
mark
in classInputStream
-
reset
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classInputStream
-