public final class SourceWrappers extends java.lang.Object
MessageBodyReader. If the return type is a
Sourcethen it doesn't close it, otherwise it closes it.
MessageBodyReaders that deliver content as RS sources: in that case we do not want Jersey to close
the backing input stream because the content has not been consumed yet when exiting
MessageBodyReader.readFrom(Class, Type, Annotation, MediaType, MultivaluedMap, InputStream) method.
Since RS sources don't implement
Source, this class provides wrappers that implement
the latter, allowing us to prevent an untimely closure of the entity input stream.
Note that this is only necessary when a user-provided entity input stream is used, which can only happen when
a filter or interceptor has replaced the one we've put in place at request creation time.
close() method of the entity stream we initially provide (
is a no-op so it doesn't matter if it gets called.
InboundMessageContext.readEntity(Class, Type, Annotation, PropertiesDelegate)
|Modifier and Type||Class and Description|