Class Message

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class Message
    extends CrtResource
    Wrapper around an instance of aws-event-stream-message. It's auto closable, so be sure to call close when finished with the object.
    • Constructor Detail

      • Message

        public Message​(java.util.List<Header> headers,
                       byte[] payload)
        Creates a message using headers and payload.
        Parameters:
        headers - list of headers to include in the message's header block. Can be null.
        payload - payload body to include in the message's payload block. Can be null.
    • Method Detail

      • getMessageBuffer

        public java.nio.ByteBuffer getMessageBuffer()
        Get the binary format of this message (i.e. for sending across the wire manually)
        Returns:
        ByteBuffer wrapping the underlying message data. This buffer is only valid as long as the message itself is valid.