mkarg 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_r328710330
########## 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: Thanks for the explanation. In fact I do not see why the upfront markable check actually bothers you: It eats up rather zero time as the implementation in the usual suspects would be `return false;`? Anyways, I have no strong feeling about removing that case if you hate it so much. ;-) Before I deep-dive into that code (I will do definitively): So what you claim is that `PushbackInputBuffer` actually is O(size of _stream_) -which would be a desaster!- instead of O(size of buffer) -which would be negligible as the buffer size is 1 byte-? Really? Didn't know that! Actually I should open a PR against the JRE to change that! ;-) ---------------------------------------------------------------- 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