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

    public T readFrom(Class<T> type, Type genType, Annotation[] anns, MediaType mt,
                      MultivaluedMap<String, String> headers, InputStream is) throws IOException {
        String string = IOUtils.toString(is, HttpUtils.getEncoding(mt, StandardCharsets.UTF_8.name()));
        if (StringUtils.isEmpty(string)) {
            reportEmptyContentLength();
        }
        if (type == Character.class) {
            char character = string.charAt(0);
            return type.cast(Character.valueOf(character));
        }
        return InjectionUtils.handleParameter(
                    string,
                    false,
                    type,
                    genType,
                    anns,
                    ParameterType.REQUEST_BODY, null);

    }

}