According to the Response.getEntity() javadoc this method MUST : "throw an IllegalStateException if the entity was previously fully consumed as an InputStream input stream". That what we started to achieve with asoldano in jira https://issues.jboss.org/browse/RESTEASY-1700, but i figured out that we forgot one case.
Following case will fail for example:
According to the Response.bufferEntity() javadoc this method MUST : "return false in case the response entity instance is not backed by an unconsumed input stream" since it will prevent reading all the bytes of the original entity input stream given that the stream is already fully or partially consumed.
Current implementation of ClientResponse does not follow those lines and following case fail for example: