class StreamSourceEntityProvider implements EntityProvider<StreamSource> {

    @Override
    public StreamSource readFrom(Class<StreamSource> type,
                                 Type genericType,
                                 Annotation[] annotations,
                                 MediaType mediaType,
                                 MultivaluedMap<String, String> httpHeaders,
                                 InputStream entityStream) throws IOException {
        return new StreamSource(entityStream);
    }

}