class PrimitiveTextProvider extends AbstractConfigurableProvider implements MessageBodyReader<T>, MessageBodyWriter<T> {

    public void writeTo(T obj, Class<?> type, Type genType, Annotation[] anns,
                        MediaType mt, MultivaluedMap<String, Object> headers,
                        OutputStream os) throws IOException {
        String encoding = HttpUtils.getSetEncoding(mt, headers, StandardCharsets.UTF_8.name());
        byte[] bytes = obj.toString().getBytes(encoding);
        os.write(bytes);

    }

}