docs: public static ImageMetaData decodeDimensionsAndColorSpace(InputStream is) {
      Preconditions.checkNotNull(is);
      ByteBuffer byteBuffer = DECODE_BUFFERS.acquire();
      if (byteBuffer == null) {
        byteBuffer = ByteBuffer.allocate(DECODE_BUFFER_SIZE);
      }
      BitmapFactory.Options options = new BitmapFactory.Options();
      options.inJustDecodeBounds = true;
      try {
        options.inTempStorage = byteBuffer.array();
        BitmapFactory.decodeStream(is, null, options);
  
        ColorSpace colorSpace = null;
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
          colorSpace = options.outColorSpace;
        }
        return new ImageMetaData(options.outWidth, options.outHeight, colorSpace);
      } finally {
        DECODE_BUFFERS.release(byteBuffer);
      }
    }