code: 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(pretty) {
  			if (fastJsonConfig.serializerFeatures == null)
  				fastJsonConfig.serializerFeatures = new  SerializerFeature[]{SerializerFeature.PrettyFormat};
              else {
                  List<SerializerFeature> serializerFeatures = Arrays.asList(fastJsonConfig.serializerFeatures);
                  serializerFeatures.add(SerializerFeature.PrettyFormat);
                  fastJsonConfig.serializerFeatures = serializerFeatures.toArray(new SerializerFeature[]{});
              }
  		}
  
  		if (fastJsonConfig.serializeFilters != null)
  			filter = fastJsonConfig.serializeFilters.get(type);
  		String jsonStr = toJSONString(t, filter, fastJsonConfig.serializerFeatures);
  		if (jsonStr != null)
  			entityStream.write(jsonStr.getBytes());
  	}
docs: Method that JAX-RS container calls to serialize given value.