|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jlab.coda.cMsg.cMsgUtilities
public class cMsgUtilities
This class stores methods which are neatly self-contained and may be used in more that one place.
Constructor Summary | |
---|---|
cMsgUtilities()
|
Method Summary | |
---|---|
static java.lang.String |
printError(int error,
int debug)
Method that returns and/or prints an error explanation. |
static int |
readSocketBytes(java.nio.ByteBuffer buffer,
java.nio.channels.SocketChannel channel,
int bytes,
int debug)
This methods reads a minimum of number of bytes from a channel into a buffer. |
static int |
readSocketBytesPlain(java.nio.ByteBuffer buffer,
java.nio.channels.SocketChannel channel,
int bytes)
This methods reads a minimum of number of bytes from a channel into a buffer. |
static void |
registerChannel(java.nio.channels.Selector selector,
java.nio.channels.SocketChannel channel,
int ops)
Registers an nio channel with a selector and sets socket parameters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public cMsgUtilities()
Method Detail |
---|
public static int readSocketBytesPlain(java.nio.ByteBuffer buffer, java.nio.channels.SocketChannel channel, int bytes) throws java.io.IOException
buffer
- a byte buffer which channel data is read intochannel
- nio socket communication channelbytes
- minimum number of bytes to read from channel
java.io.IOException
- If channel is closed or cannot be read frompublic static int readSocketBytes(java.nio.ByteBuffer buffer, java.nio.channels.SocketChannel channel, int bytes, int debug) throws java.io.IOException
buffer
- a byte buffer which channel data is read intochannel
- nio socket communication channelbytes
- minimum number of bytes to read from channeldebug
- level of debug output
java.io.IOException
- If channel is closed or cannot be read frompublic static void registerChannel(java.nio.channels.Selector selector, java.nio.channels.SocketChannel channel, int ops) throws java.io.IOException
selector
- object which handles channel readiness stateschannel
- nio socket communication channelops
- selector's operation
java.io.IOException
- If socket parameters cannot be set or channel is closedpublic static java.lang.String printError(int error, int debug)
error
- error numberdebug
- level of debug output
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |