org.springframework.messaging.simp.stomp

## Class StompEncoder

- java.lang.Object
- - org.springframework.messaging.simp.stomp.StompEncoder

    public class StompEncoder
    extends Object

An encoder for STOMP frames.

Since:
  4.0
Author:
  Andy Wilkinson, Rossen Stoyanchev
See Also:
  `StompDecoder`

### Constructor Summary

Constructors
Constructor and Description
`StompEncoder()`

### Method Summary

All Methods Instance Methods Concrete Methods
`byte[]` `encode(Map<String,Object> headers, byte[] payload)` Encodes the given payload and headers into a `byte[]`.
`byte[]` `encode(Message<byte[]> message)` Encodes the given STOMP `message` into a `byte[]`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### StompEncoder

    public StompEncoder()

### Method Detail

#### encode

    public byte[] encode(Message<byte[]> message)

Encodes the given STOMP `message` into a `byte[]`.

Parameters:
  `message` - the message to encode
Returns:
  the encoded message

#### encode

    public byte[] encode(Map<String,Object> headers,
                         byte[] payload)

Encodes the given payload and headers into a `byte[]`.

Parameters:
  `headers` - the headers
  `payload` - the payload
Returns:
  the encoded message