## 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
`protected static Logger` `log` Logger

Constructor Summary
`RemotingProtocolEncoder()`

Method Summary
`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 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

Copyright © 2006-2010 The Red5 Project