com.gatespace.service.adc.impl
Class Util
java.lang.Object
|
+--com.gatespace.service.adc.impl.Util
- public class Util
- extends java.lang.Object
Utility class with some low-level routines.
Constructor Summary |
Util()
|
Util(int maxErrCount)
|
Method Summary |
void |
error(java.lang.String s)
|
static void |
main(java.lang.String[] argv)
|
static byte |
readByte(java.io.InputStream in)
Polled read of a single byte from an input stream. |
static void |
readBytes(java.io.InputStream in,
byte[] buf)
Polled read of bytes from an input stream. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Util
public Util()
Util
public Util(int maxErrCount)
readByte
public static byte readByte(java.io.InputStream in)
throws java.io.IOException
- Polled read of a single byte from an input stream.
- Parameters:
in
- stream to read from- Returns:
- byte read from stream
- Throws:
- java.io.IOException - when read fails or timeout
readBytes
public static void readBytes(java.io.InputStream in,
byte[] buf)
throws java.io.IOException
- Polled read of bytes from an input stream.
This method polles the stream for available bytes
a number of times (se impl) until it either receives
buf.length bytes, or timeouts. The reason for not using the
blocking is that blocking IO blocks a bit too hard
on some JVM implementations.
- Parameters:
in
- stream to read frombuf
- byte array to store bytes in. TRies to read buf.length bytes.- Throws:
- java.io.IOException - when read fails or timeout
error
public void error(java.lang.String s)
main
public static void main(java.lang.String[] argv)