Interface MessageBuffer

All Known Implementing Classes:
GreedyMessageBuffer, LazyMessageBuffer

public interface MessageBuffer
Accumulates network data into Message objects. This allows random chunks of bytes to be assembled into messages even if the buffer boundaries don't line up.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    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.
  • Method Details

    • pollMessage

      Message pollMessage()
      Returns the next message in the buffer or null if there are no more messages in the buffer.
    • hasMessages

      boolean hasMessages()
      Returns true if there is a message waiting in the buffer.
    • addBytes

      boolean addBytes(ByteBuffer buffer)
      Adds byte data to the message buffer. Returns true if there is a message waiting after this call.