org.springframework.web.socket.sockjs.frame

## Interface SockJsMessageCodec

All Known Implementing Classes:
  AbstractSockJsMessageCodec, Jackson2SockJsMessageCodec

    public interface SockJsMessageCodec

Encode and decode messages to and from a SockJS message frame, essentially an array of JSON-encoded messages. For example:

     a["message1","message2"]

Since:
  4.0
Author:
  Rossen Stoyanchev

### Method Summary

All Methods Instance Methods Abstract Methods
`String[]` `decode(String content)` Decode the given SockJS message frame.
`String[]` `decodeInputStream(InputStream content)` Decode the given SockJS message frame.
`String` `encode(String... messages)` Encode the given messages as a SockJS message frame.

### Method Detail

#### encode

    String encode(String... messages)

Encode the given messages as a SockJS message frame. Aside from applying standard JSON quoting to each message, there are some additional JSON Unicode escaping rules. See the "JSON Unicode Encoding" section of SockJS protocol (i.e. the protocol test suite).

Parameters:
  `messages` - the messages to encode
Returns:
  the content for a SockJS message frame (never `null`)

#### decode

    @Nullable
    String[] decode(String content)
                       throws IOException

Decode the given SockJS message frame.

Parameters:
  `content` - the SockJS message frame
Returns:
  an array of messages, or `null` if none
Throws:
  `IOException` - if the content could not be parsed

#### decodeInputStream

    @Nullable
    String[] decodeInputStream(InputStream content)
                                  throws IOException

Decode the given SockJS message frame.

Parameters:
  `content` - the SockJS message frame
Returns:
  an array of messages, or `null` if none
Throws:
  `IOException` - if the content could not be parsed