Class LazyMessageBuffer

java.lang.Object
com.jme3.network.base.protocol.LazyMessageBuffer
All Implemented Interfaces:
MessageBuffer

public class LazyMessageBuffer extends Object implements 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 Details

  • Method Details

    • pollMessage

      public Message pollMessage()
      Returns the next message in the buffer or null if there are no more messages in the buffer.
      Specified by:
      pollMessage in interface MessageBuffer
    • hasMessages

      public boolean hasMessages()
      Returns true if there is a message waiting in the buffer.
      Specified by:
      hasMessages in interface MessageBuffer
    • addBytes

      public boolean addBytes(ByteBuffer buffer)
      Adds byte data to the message buffer. Returns true if there is a message waiting after this call.
      Specified by:
      addBytes in interface MessageBuffer