private PooledByteBufferOutputStream merge(EncodedImage initialData, EncodedImage remainingData)
        throws IOException {
      int bytesToReadFromInitialData =
          Preconditions.checkNotNull(remainingData.getBytesRange()).from;
      final int totalLength = remainingData.getSize() + bytesToReadFromInitialData;
      final PooledByteBufferOutputStream pooledOutputStream =
          mPooledByteBufferFactory.newOutputStream(totalLength);

      // Only read from the original image data up to the start of the new data
      copy(initialData.getInputStreamOrThrow(), pooledOutputStream, bytesToReadFromInitialData);
      copy(remainingData.getInputStreamOrThrow(), pooledOutputStream, remainingData.getSize());

      return pooledOutputStream;
    }
Consumer that consumes results from next producer in the sequence.

<p>If the consumer receives a partial result, it caches it on disk with an appropriate key to
differentiate from the full image.

<p>If a partial image is already held, it combines new results with that partial data and
passes the combination to the next consumer.
imagepipeline/src/main/java/com/facebook/imagepipeline/producers/PartialDiskCacheProducer.java