src/main/java/com/alipay/remoting/CustomSerializerManager.java
public static void registerCustomSerializer(CommandCode code, CustomSerializer serializer) {
        CustomSerializer prevSerializer = commandCustomSerializer.putIfAbsent(code, serializer);
        if (prevSerializer != null) {
            throw new RuntimeException("CustomSerializer has been registered for command code: "
                                       + code + ", the custom serializer is: "
                                       + prevSerializer.getClass().getName());
        }
    }
public static void registerCustomSerializer(CommandCode code, CustomSerializer serializer) {
        CustomSerializer prevSerializer = commandCustomSerializer.putIfAbsent(code, serializer);
        if (prevSerializer != null) {
            throw new RuntimeException("CustomSerializer has been registered for command code: "
                                       + code + ", the custom serializer is: "
                                       + prevSerializer.getClass().getName());
        }
    }
Register custom serializer for command code.

@param code
@param serializer
@return