Package com.saperion.common.streams
Class BlockingInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.saperion.common.streams.BlockingInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class BlockingInputStream extends java.io.InputStream
The Class BlockingInputStream.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.InputStream
is
The stream.
-
Constructor Summary
Constructors Constructor Description BlockingInputStream(java.io.InputStream is)
Instantiates a new blocking input stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
void
mark(int readLimit)
boolean
markSupported()
int
read()
int
read(byte[] bf)
Blocking Read.int
read(byte[] bf, int s, int l)
void
reset()
long
skip(long n)
-
-
-
Method Detail
-
available
public int available() throws java.io.IOException
- Overrides:
available
in classjava.io.InputStream
- Throws:
java.io.IOException
- See Also:
InputStream.available()
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.InputStream
- Throws:
java.io.IOException
- See Also:
InputStream.close()
-
mark
public void mark(int readLimit)
- Overrides:
mark
in classjava.io.InputStream
- See Also:
InputStream.mark(int)
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classjava.io.InputStream
- See Also:
InputStream.markSupported()
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
- See Also:
InputStream.read()
-
read
public int read(byte[] bf) throws java.io.IOException
Blocking Read.- Overrides:
read
in classjava.io.InputStream
- Parameters:
bf
- the buffer to fill- Returns:
- the number of read bytes or -1 if the end of the stream is reached.
- Throws:
java.io.IOException
- Signals that an I/O exception has occurred.- See Also:
InputStream.read(byte[])
-
read
public int read(byte[] bf, int s, int l) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
- See Also:
InputStream.read(byte[], int, int)
-
reset
public void reset() throws java.io.IOException
- Overrides:
reset
in classjava.io.InputStream
- Throws:
java.io.IOException
- See Also:
InputStream.reset()
-
skip
public long skip(long n) throws java.io.IOException
- Overrides:
skip
in classjava.io.InputStream
- Throws:
java.io.IOException
- See Also:
InputStream.skip(long)
-
-