/**
* Method that JAX-RS container calls to serialize given value.
*/
public void writeTo(Object t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders,
OutputStream entityStream) throws IOException, WebApplicationException {
SerializeFilter filter = null;
if (fastJsonConfig.serializeFilters != null)
filter = fastJsonConfig.serializeFilters.get(type);
String jsonStr = toJSONString(t, filter, fastJsonConfig.serializerFeatures);
if (jsonStr != null)
entityStream.write(jsonStr.getBytes());