Package com.jme3.network.base.protocol
Class GreedyMessageBuffer
java.lang.Object
com.jme3.network.base.protocol.GreedyMessageBuffer
- All Implemented Interfaces:
 MessageBuffer
A MessageBuffer implementation that will aggressively create
  all messages as byte data comes in.  In other words, if there
  are four messages in the ByteBuffer passed to addBuffer() then
  all of the messages will be deserialized during that call and
  queued up for later return.  The downside is that, if any of
  those messages was going to alter the MessageProtocol serialization
  behavior in a way that affects later messages, then problems occur
  when those messages are all in one block.
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionbooleanaddBytes(ByteBuffer buffer) Adds byte data to the message buffer.booleanReturns 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
- 
GreedyMessageBuffer
 
 - 
 - 
Method Details
- 
pollMessage
Returns the next message in the buffer or null if there are no more messages in the buffer.- Specified by:
 pollMessagein interfaceMessageBuffer
 - 
hasMessages
public boolean hasMessages()Returns true if there is a message waiting in the buffer.- Specified by:
 hasMessagesin interfaceMessageBuffer
 - 
addBytes
Adds byte data to the message buffer. Returns true if there is a message waiting after this call.- Specified by:
 addBytesin interfaceMessageBuffer
 
 -