org.red5.server.net.remoting.codec

## Class RemotingProtocolEncoder

- java.lang.Object
- - org.red5.server.net.remoting.codec.RemotingProtocolEncoder

    public class RemotingProtocolEncoder
    extends Object

Remoting protocol encoder.

### Field Summary

Fields
`protected static org.slf4j.Logger` `log` Logger

### Constructor Summary

Constructors
Constructor and Description
`RemotingProtocolEncoder()`

### Method Summary

Methods
`IoBuffer` `encode(ProtocolState state, Object message)` Encodes the given buffer.
`protected StatusObject` `generateErrorResult(String code, Throwable error)` Generate error object to return for given exception.
`void` `setSerializer(Serializer serializer)` Setter for serializer.

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

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

### Field Detail

#### log

    protected static org.slf4j.Logger log

Logger

### Constructor Detail

#### RemotingProtocolEncoder

    public RemotingProtocolEncoder()

### Method Detail

#### encode

    public IoBuffer encode(ProtocolState state,
                  Object message)
                    throws Exception

Encodes the given buffer.

Parameters:
  `state` -
  `message` -
Returns:
  buffer
Throws:
  `Exception`

#### generateErrorResult

    protected StatusObject generateErrorResult(String code,
                                   Throwable error)

Generate error object to return for given exception.

Parameters:
  `code` - call
  `error` - error
Returns:
  status object

#### setSerializer

    public void setSerializer(Serializer serializer)

Setter for serializer.

Parameters:
  `serializer` - New serializer