public class SimpleBinaryMessage extends java.lang.Object implements MessageAppender
Modifier and Type | Field and Description |
---|---|
private static int |
BUFFER_SIZE |
protected boolean |
finished |
private EventDriver |
onEvent |
protected java.io.ByteArrayOutputStream |
out |
private int |
size |
Constructor and Description |
---|
SimpleBinaryMessage(EventDriver onEvent) |
Modifier and Type | Method and Description |
---|---|
void |
appendFrame(java.nio.ByteBuffer payload,
boolean isLast)
Append the frame payload to the message.
|
void |
messageComplete()
Notification that message is to be considered complete.
|
private static final int BUFFER_SIZE
private final EventDriver onEvent
protected final java.io.ByteArrayOutputStream out
private int size
protected boolean finished
public SimpleBinaryMessage(EventDriver onEvent)
public void appendFrame(java.nio.ByteBuffer payload, boolean isLast) throws java.io.IOException
MessageAppender
appendFrame
in interface MessageAppender
payload
- the frame payload to append.isLast
- flag indicating if this is the last part of the message or not.java.io.IOException
- if unable to append the frame payloadpublic void messageComplete()
MessageAppender
Any cleanup or final actions should be taken here.
messageComplete
in interface MessageAppender