Class BinaryExtension

java.lang.Object
org.cometd.client.ext.BinaryExtension
All Implemented Interfaces:
ClientSession.Extension

public class BinaryExtension extends Object implements ClientSession.Extension

A client extension that encodes byte[] or ByteBuffer into a BinaryData object using the Z85 format for outgoing messages, and decodes BinaryData objects back into byte[] or ByteBuffer for incoming messages.

  • Constructor Details

    • BinaryExtension

      public BinaryExtension()
    • BinaryExtension

      public BinaryExtension(boolean decodeToByteBuffer)
  • Method Details

    • rcv

      public boolean rcv(ClientSession session, Message.Mutable message)
      Description copied from interface: ClientSession.Extension
      Callback method invoked every time a normal message is received.
      Specified by:
      rcv in interface ClientSession.Extension
      Parameters:
      session - the session object that is receiving the message
      message - the message received
      Returns:
      true if message processing should continue, false if it should stop
    • send

      public boolean send(ClientSession session, Message.Mutable message)
      Description copied from interface: ClientSession.Extension
      Callback method invoked every time a normal message is being sent.
      Specified by:
      send in interface ClientSession.Extension
      Parameters:
      session - the session object that is sending the message
      message - the message being sent
      Returns:
      true if message processing should continue, false if it should stop