docs: @Override
    protected Bitmap decodeJPEGByteArrayAsPurgeable(
        CloseableReference<PooledByteBuffer> bytesRef, int length, BitmapFactory.Options options) {
      byte[] suffix = endsWithEOI(bytesRef, length) ? null : EOI;
      final PooledByteBuffer pooledByteBuffer = bytesRef.get();
      Preconditions.checkArgument(length <= pooledByteBuffer.size());
      // allocate bigger array in case EOI needs to be added
      final CloseableReference<byte[]> encodedBytesArrayRef = mFlexByteArrayPool.get(length + 2);
      try {
        byte[] encodedBytesArray = encodedBytesArrayRef.get();
        pooledByteBuffer.read(0, encodedBytesArray, 0, length);
        if (suffix != null) {
          putEOI(encodedBytesArray, length);
          length += 2;
        }
        Bitmap bitmap = BitmapFactory.decodeByteArray(
            encodedBytesArray,
            0,
            length,
            options);
        return Preconditions.checkNotNull(bitmap, "BitmapFactory returned null");
      } finally {
        CloseableReference.closeSafely(encodedBytesArrayRef);
      }
    }