rmannibucau commented on a change in pull request #52: JOHNZON-281 JAX-RS 
Provider MUST throw NoContentException
URL: https://github.com/apache/johnzon/pull/52#discussion_r328642634
 
 

 ##########
 File path: 
johnzon-jsonb/src/main/java/org/apache/johnzon/jaxrs/jsonb/jaxrs/JsonbJaxrsProvider.java
 ##########
 @@ -187,7 +189,23 @@ public long getSize(final T t, final Class<?> type, final 
Type genericType, fina
 
     @Override
     public T readFrom(final Class<T> type, final Type genericType, final 
Annotation[] annotations, final MediaType mediaType,
-            final MultivaluedMap<String, String> httpHeaders, final 
InputStream entityStream) throws IOException, WebApplicationException {
+            final MultivaluedMap<String, String> httpHeaders, InputStream 
entityStream) throws IOException, WebApplicationException {
+        if (entityStream.markSupported()) {
 
 Review comment:
   1. can be solved by a bench but from what you say mainstream is not markable 
(only payara?) so it shouldn't be the first citizen probably?
   2. the benefit is the speed, overhead in O(1) vs O(size of the stream) (you 
can bench it on small, medium, huge streams)
   3. this is not that hard or slow ;). My main point is we can't slow down a 
stream more than we do already, it is the slowest part we have and here we try 
to handle a case which never happens (literally) so any overhead in O(n) is 
negative for real users.
   4. I didnt read that answer :D

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to