com.pentec.util
Class ABufferedInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.BufferedInputStream
com.pentec.util.ABufferedInputStream
- All Implemented Interfaces:
- java.io.Closeable
public class ABufferedInputStream
- extends java.io.BufferedInputStream
BufferedInputStream with a timeout (in milliseconds) built in rather than
depending on the underlying source to provide one.
|
Field Summary |
private int |
iTimeout
Amount of time to dwell on a read before timing out |
| Fields inherited from class java.io.BufferedInputStream |
buf, count, marklimit, markpos, pos |
| Fields inherited from class java.io.FilterInputStream |
in |
|
Method Summary |
int |
read()
|
int |
read(byte[] abBuffer)
|
int |
read(byte[] abBuffer,
int iOffset,
int iLength)
|
protected void |
wait(int iBytes)
Wait until iBytes number of bytes are available to read before returning. |
| Methods inherited from class java.io.BufferedInputStream |
available, close, mark, markSupported, reset, skip |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
iTimeout
private int iTimeout
- Amount of time to dwell on a read before timing out
ABufferedInputStream
public ABufferedInputStream(java.io.InputStream in,
int iTimeout)
ABufferedInputStream
public ABufferedInputStream(java.io.InputStream in,
int iSize,
int iTimeout)
read
public int read()
throws java.io.IOException
- Overrides:
read in class java.io.BufferedInputStream
- Throws:
java.io.IOException
read
public int read(byte[] abBuffer)
throws java.io.IOException
- Overrides:
read in class java.io.FilterInputStream
- Throws:
java.io.IOException
read
public int read(byte[] abBuffer,
int iOffset,
int iLength)
throws java.io.IOException
- Overrides:
read in class java.io.BufferedInputStream
- Throws:
java.io.IOException
wait
protected void wait(int iBytes)
throws java.io.IOException
- Wait until iBytes number of bytes are available to read before returning.
If the timeout period elapses, an IOException is thrown indicating so.
- Parameters:
iBytes - number of bytes to wait on
- Throws:
java.io.IOException - timeout period elapsed