code: public static Object fromInputStream(InputStream input) throws IOException {
          // filter BOMs from InputStream
          try (final BOMInputStream bOMInputStream = new BOMInputStream(input, false,
                  ByteOrderMark.UTF_8, ByteOrderMark.UTF_16BE, ByteOrderMark.UTF_16LE,
                  ByteOrderMark.UTF_32BE, ByteOrderMark.UTF_32LE);) {
              Charset charset = StandardCharsets.UTF_8;
              // Attempt to use the BOM if it exists
              if (bOMInputStream.hasBOM()) {
                  try {
                      charset = Charset.forName(bOMInputStream.getBOMCharsetName());
                  } catch (final IllegalArgumentException e) {
                      // If there are any issues with the BOM charset, attempt to
                      // parse with UTF_8
                      charset = StandardCharsets.UTF_8;
                  }
              }
              return fromInputStream(bOMInputStream, charset);
          }
      }
docs: Parses a JSON-LD document from the given {@link InputStream} to an object
  that can be used as input for the {@link JsonLdApi} and
  {@link JsonLdProcessor} methods.<br>
  Uses UTF-8 as the character encoding when decoding the InputStream.
  
  @param input
  The JSON-LD document in an InputStream.
  @return A JSON Object.
  @throws JsonParseException
  If there was a JSON related error during parsing.
  @throws IOException
  If there was an IO error during parsing.