|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.mbari.siam.utils.StreamUtils
public class StreamUtils
| Constructor Summary | |
|---|---|
StreamUtils()
|
|
| Method Summary | |
|---|---|
static int |
readBytes(java.io.InputStream instream,
byte[] outbuf,
int startIndex,
int nBytes,
long timeout)
Read characters from input stream into buffer, until specified number of characters have been read, or operation times out. |
static int |
readUntil(java.io.InputStream instream,
byte[] outbuf,
byte[] terminator,
long timeout)
Read characters from input stream into buffer, until specified terminator is encountered. |
static int |
skipUntil(java.io.InputStream instream,
byte[] terminator,
long timeout)
Skip streaming characters until specified terminator is encountered or until buffer if full (deprecated) Note that it is possible to ignore timeout by setting it to 0. |
static int |
skipUntil(java.io.InputStream instream,
byte[] terminator,
long timeout,
int maxBytes)
Read characters from input stream into buffer, until specified terminator is encountered, maxBytes are received, or timeout milliseconds elapse. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StreamUtils()
| Method Detail |
|---|
public static int readUntil(java.io.InputStream instream,
byte[] outbuf,
byte[] terminator,
long timeout)
throws TimeoutException,
java.lang.NullPointerException,
java.io.IOException,
java.lang.Exception
instream - input streamoutbuf - output bufferterminator - terminator character string
TimeoutException
java.lang.NullPointerException
java.io.IOException
java.lang.Exception
public static int skipUntil(java.io.InputStream instream,
byte[] terminator,
long timeout,
int maxBytes)
throws TimeoutException,
java.lang.NullPointerException,
java.io.IOException,
java.lang.Exception
instream - input streamterminator - terminator character stringtimeout - stop after timeout msmaxBytes - stop after maxBytes skipped
TimeoutException
java.lang.NullPointerException
java.io.IOException
java.lang.Exception
public static int skipUntil(java.io.InputStream instream,
byte[] terminator,
long timeout)
throws TimeoutException,
java.io.IOException,
java.lang.NullPointerException,
java.lang.Exception
instream - input streamterminator - termination character stringtimeout - timeout in milliseconds
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception
public static int readBytes(java.io.InputStream instream,
byte[] outbuf,
int startIndex,
int nBytes,
long timeout)
throws java.io.IOException,
java.lang.Exception
instream - input streamoutbuf - output bufferstartIndex - start filling output buffer fromt this indexnBytes - number of bytes to readtimeout - in millisec
java.io.IOException
java.lang.Exception
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||