用Spring Boot HttpMessageConverter返回值为Null时如何处理

public class MessageConverter extends AbstractHttpMessageConverter {

@Override
protected boolean supports(Class<?> clazz) {
    return true;
}

public MessageConverter() {
    super(MediaType.ALL);
}

@Override
protected Object readInternal(Class<?> aClass, HttpInputMessage httpInputMessage) throws IOException, HttpMessageNotReadableException {
    return null;
}

@Override
protected void writeInternal(Object o, HttpOutputMessage httpOutputMessage) throws IOException {
    if (o instanceof ResultBody) {
        FileCopyUtils.copy(JSON.toJSONString(o).getBytes(), httpOutputMessage.getBody());
    } else {
        ResultBody body = new ResultBody(o);
        FileCopyUtils.copy(JSON.toJSONString(body).getBytes(), httpOutputMessage.getBody());
    }
}

}

@RequestMapping(value = "demo3", method = RequestMethod.GET)
@SystemType(Constants.SYSTEM_PLATFORM)
@NoNeedLogin
String demo3(@RequestParam(value = "str") String str) {
System.out.println(str);
return null;
}

    直接返回null的话就不走writeInternal函数。
    返回值之类为void时,也一样的

https://www.baidu.com/link?url=JfEPtBvRo_LQzxPraSgcQv4Z7dM-pKkryj6jRYlSPxA325hdCrgcPJUvgSdKcsKt8nSJhz4dFPqo7ZERczbdrq&wd=&eqid=e4a44e410010b83c0000000558c333f4