public class MessageFrame
extends io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame
MessagingClient and MessagingServer. This frame has two information:
MessageFrame.MessageType for the message: This is the first byte in the frame data. | Modifier and Type | Class and Description |
|---|---|
static class |
MessageFrame.MessageType |
| Constructor and Description |
|---|
MessageFrame(io.netty.buffer.ByteBuf binaryData)
Creates a new frame from existing data, usually used for reading a frame of the wire.
|
MessageFrame(MessageFrame.MessageType type,
long id)
Constructs a new frame, usually used for writing with the passed message type and id.
|
MessageFrame(MessageFrame.MessageType type,
long id,
io.netty.buffer.ByteBufAllocator allocator)
Constructs a new frame, usually used for writing with the passed message type and id.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getId() |
MessageFrame.MessageType |
getType() |
java.lang.String |
toString() |
copy, duplicate, replace, retain, retain, retainedDuplicate, touch, touchisFinalFragment, rsvpublic MessageFrame(MessageFrame.MessageType type, long id)
type - Type of the message.id - Id of the message.public MessageFrame(MessageFrame.MessageType type, long id, io.netty.buffer.ByteBufAllocator allocator)
type - Type of the message.id - Id of the message.allocator - An allocator for allocating the buffer for this frame.public MessageFrame(io.netty.buffer.ByteBuf binaryData)
binaryData - Data representing a message frame.java.lang.IllegalArgumentException - If the message type is unknown.java.lang.IndexOutOfBoundsException - If the frame is malformed and does not contain the data in the format required.public long getId()
public MessageFrame.MessageType getType()
public java.lang.String toString()
toString in class io.netty.handler.codec.http.websocketx.WebSocketFrame