@Override
  public Object decode(Response response, Type type) throws IOException {
    if (response.status() == 404 || response.status() == 204) return Util.emptyValueOf(type);
    if (response.body() == null) return null;
    Reader reader = response.body().asReader(UTF_8);
    if (!reader.markSupported()) {
      reader = new BufferedReader(reader, 1);
    }
    try {
      // Read the first byte to see if we have any data
      reader.mark(1);
      if (reader.read() == -1) {
        return null; // Eagerly returning null avoids "No content to map due to end-of-input"
      }
      reader.reset();
      return new JacksonIterator<Object>(
          actualIteratorTypeArgument(type), mapper, response, reader);
    } catch (RuntimeJsonMappingException e) {
      if (e.getCause() != null && e.getCause() instanceof IOException) {
        throw IOException.class.cast(e.getCause());
      }
      throw e;
    }
  }
Jackson decoder which return a closeable iterator. Returned iterator auto-close the {@code
Response} when it reached json array end or failed to parse stream. If this iterator is not
fetched till the end, it has to be casted to {@code Closeable} and explicity {@code
Closeable#close} by the consumer.

<p>

<p>

<p>Example: <br>

<pre>
<code>
Feign.builder()
  .decoder(JacksonIteratorDecoder.create())
  .doNotCloseAfterDecode() // Required to fetch the iterator after the response is processed, need to be close
  .target(GitHub.class, "https://api.github.com");
interface GitHub {
 {@literal @}RequestLine("GET /repos/{owner}/{repo}/contributors")
  Iterator<Contributor> contributors(@Param("owner") String owner, @Param("repo") String repo);
}</code>
</pre>
jackson/src/main/java/feign/jackson/JacksonIteratorDecoder.java