|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.grizzly.util.Utils
public class Utils
Class contains set of useful operations commonly used in the framework
| Constructor Summary | |
|---|---|
Utils()
|
|
| Method Summary | |
|---|---|
static byte[] |
extractBytes(ByteBuffer byteBuffer,
byte startByte,
byte endByte)
Return the bytes contained between the startByte and the endByte. |
static int |
findBytes(ByteBuffer byteBuffer,
byte[] b)
Specialized utility method: find a sequence of lower case bytes inside a ByteBuffer. |
static int |
readWithTemporarySelector(SelectableChannel channel,
ByteBuffer byteBuffer,
long readTimeout)
Method reads data from SelectableChannel to
ByteBuffer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Utils()
| Method Detail |
|---|
public static int readWithTemporarySelector(SelectableChannel channel,
ByteBuffer byteBuffer,
long readTimeout)
throws IOException
SelectableChannel to
ByteBuffer. If data is not immediately available - channel
will be reregistered on temporary Selector and wait maximum
readTimeout milliseconds for data.
channel - SelectableChannel to read data frombyteBuffer - ByteBuffer to store read data toreadTimeout - maximum time in millis operation will wait for
incoming data
IOException - if any error was occured during read
IOException
public static byte[] extractBytes(ByteBuffer byteBuffer,
byte startByte,
byte endByte)
throws IOException
byteBuffer - The bytes.startByte - the first byte to look forendByte - the second byte to look for
IOException
public static int findBytes(ByteBuffer byteBuffer,
byte[] b)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||