public void writeTo(T obj, Class<?> cls, Type type, Annotation[] anns, MediaType mt,
MultivaluedMap<String, Object> headers, OutputStream os) throws IOException,
WebApplicationException {
DataFormat format = getValidDataFormat(mt);
try {
format.marshal(null, obj, os);
} catch (Exception ex) {
throw new InternalServerErrorException(ex);
}
}