|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectcom.jme3.network.base.MessageProtocol
public class MessageProtocol
Consolidates the conversion of messages to/from byte buffers and provides a rolling message buffer. ByteBuffers can be pushed in and messages will be extracted, accumulated, and available for retrieval. This is not thread safe and is meant to be used within a single message processing thread.
The protocol is based on a simple length + data format where two bytes represent the (short) length of the data and the rest is the raw data for the Serializers class.
| コンストラクタの概要 | |
|---|---|
MessageProtocol()
|
|
| メソッドの概要 | |
|---|---|
int |
addBuffer(java.nio.ByteBuffer buffer)
Adds the specified buffer, extracting the contained messages and making them available to getMessage(). |
Message |
getMessage()
Retrieves and removes an extracted message from the accumulated buffer or returns null if there are no more messages. |
static java.nio.ByteBuffer |
messageToBuffer(Message message,
java.nio.ByteBuffer target)
Converts a message to a ByteBuffer using the Serializer and the (short length) + data protocol. |
| クラス java.lang.Object から継承されたメソッド |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| コンストラクタの詳細 |
|---|
public MessageProtocol()
| メソッドの詳細 |
|---|
public static java.nio.ByteBuffer messageToBuffer(Message message,
java.nio.ByteBuffer target)
public Message getMessage()
public int addBuffer(java.nio.ByteBuffer buffer)
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||