|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.grizzly.filter.CustomProtocolHelper
public class CustomProtocolHelper
Varoius small ByteBuffer helpers for logging and ByteBuffer handling.
Constructor Summary | |
---|---|
CustomProtocolHelper()
|
Method Summary | |
---|---|
static boolean |
byteBufferHasEnoughSpace(int neededBytes,
ByteBuffer buf)
|
static ByteBuffer |
giveGrizzlyNewByteBuffer()
Gives current Thread a completely new Bytebuffer of @see Message.MessageMaxLength |
static void |
giveGrizzlyNewByteBuffer(ByteBuffer buf)
Gives current Thread a completely new Bytebuffer of @see Message.MessageMaxLength with the given byteBuffer copied into it. |
static boolean |
isPrintable(char c)
|
static void |
log(String msg)
|
static void |
logFine(String msg,
Throwable t)
|
static Logger |
logger()
Return the current Logger used Customprotocol. |
static String |
printBuffer(String msg,
ByteBuffer buffer)
Print the contents of the buffer out to the PrintStream in hex and ASCII. |
static ByteBuffer |
sliceBuffer(ByteBuffer byteBuffer,
int start,
int end)
|
static void |
startController(Controller controller)
|
static void |
stopController(Controller controller)
Stop controller in seperate thread |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CustomProtocolHelper()
Method Detail |
---|
public static boolean byteBufferHasEnoughSpace(int neededBytes, ByteBuffer buf)
neededBytes
- number of bytes that the given buffer should be able to holdbuf
- the bytebuffer which is queried for free space
public static ByteBuffer giveGrizzlyNewByteBuffer()
public static void giveGrizzlyNewByteBuffer(ByteBuffer buf)
buf
- the buffer which should be put into the newly created byteBuffer.public static ByteBuffer sliceBuffer(ByteBuffer byteBuffer, int start, int end)
public static Logger logger()
Logger
used Customprotocol.
public static void logFine(String msg, Throwable t)
public static void log(String msg)
public static String printBuffer(String msg, ByteBuffer buffer)
msg
- The message to use as the header for this displaybuffer
- The ByteBuffer containing the data. The contents
from 0 to buffer.position() are printed out. Remember to set
position!public static boolean isPrintable(char c)
public static void startController(Controller controller)
public static void stopController(Controller controller)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |