Package com.jme3.network.base.protocol
Class LazyMessageBuffer
java.lang.Object
com.jme3.network.base.protocol.LazyMessageBuffer
- All Implemented Interfaces:
MessageBuffer
A MessageBuffer implementation that will deserialize messages as they
are returned instead of deserializing them as the data comes in. This
allows the individual messages to be processed before later messages
are deserialized, thus allowing the serialization process itself to be
altered mid-stream.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addBytes
(ByteBuffer buffer) Adds byte data to the message buffer.boolean
Returns true if there is a message waiting in the buffer.Returns the next message in the buffer or null if there are no more messages in the buffer.
-
Constructor Details
-
LazyMessageBuffer
-
-
Method Details
-
pollMessage
Returns the next message in the buffer or null if there are no more messages in the buffer.- Specified by:
pollMessage
in interfaceMessageBuffer
-
hasMessages
public boolean hasMessages()Returns true if there is a message waiting in the buffer.- Specified by:
hasMessages
in interfaceMessageBuffer
-
addBytes
Adds byte data to the message buffer. Returns true if there is a message waiting after this call.- Specified by:
addBytes
in interfaceMessageBuffer
-