docs: @Override
    public CloseableReference<Bitmap> decodeFromEncodedImageWithColorSpace(
        final EncodedImage encodedImage,
        Bitmap.Config bitmapConfig,
        @Nullable Rect regionToDecode,
        @Nullable final ColorSpace colorSpace) {
      BitmapFactory.Options options = getBitmapFactoryOptions(
          encodedImage.getSampleSize(),
          bitmapConfig);
      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
        OreoUtils.setColorSpace(options, colorSpace);
      }
      CloseableReference<PooledByteBuffer> bytesRef = encodedImage.getByteBufferRef();
      Preconditions.checkNotNull(bytesRef);
      try {
        Bitmap bitmap = decodeByteArrayAsPurgeable(bytesRef, options);
        return pinBitmap(bitmap);
      } finally {
        CloseableReference.closeSafely(bytesRef);
      }
    }