public CloseableStaticBitmap decodeJpeg(
      final EncodedImage encodedImage,
      int length,
      QualityInfo qualityInfo,
      ImageDecodeOptions options,
      @Nullable ColorSpace colorSpace) {
    CloseableReference<Bitmap> bitmapReference =
        mPlatformDecoder.decodeJPEGFromEncodedImageWithColorSpace(
            encodedImage, options.bitmapConfig, null, length, colorSpace);
    try {
      boolean didApplyTransformation =
          TransformationUtils.maybeApplyTransformation(
              options.bitmapTransformation, bitmapReference);

      Preconditions.checkNotNull(bitmapReference);
      CloseableStaticBitmap closeableStaticBitmap =
          CloseableStaticBitmap.of(
              bitmapReference,
              qualityInfo,
              encodedImage.getRotationAngle(),
              encodedImage.getExifOrientation());

      closeableStaticBitmap.putExtra(
          HasExtraData.KEY_IS_ROUNDED,
          didApplyTransformation && options.bitmapTransformation instanceof CircularTransformation);

      return closeableStaticBitmap;
    } finally {
      CloseableReference.closeSafely(bitmapReference);
    }
  }
Decodes a partial jpeg.

@param encodedImage input image (encoded bytes plus meta data)
@param length amount of currently available data in bytes
@param qualityInfo quality info for the image
@return a CloseableStaticBitmap
imagepipeline/src/main/java/com/facebook/imagepipeline/decoder/DefaultImageDecoder.java