|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface that represents a message read from/written into channels. It should know how to read/write itself from/into the channel.
Please use instanceof
operator to determine the type of the
message.
Method Summary | |
boolean |
read(ByteBuffer buffer)
Reads the message from the specified buffer. |
boolean |
write(ByteBuffer buffer)
Writes this message into the specified buffer. |
Method Detail |
public boolean read(ByteBuffer buffer) throws MessageParseException
position
will be 0
and
limit
will be the number of bytes read.
true
if the message is read fully.
false
if the buffer is exhausted and more bytes
are left to read, or if more bytes are required to complete the
message.
MessageParseException
- if the bytes in the buffer is not understandable.public boolean write(ByteBuffer buffer)
true
. the position
will be 0
and limit
will be the same as capacity
.
true
if the message is written fully.
false
if the buffer is full and more bytes are
left to write, or the message wants to write the remainder at
next invocation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |