This is the same as
{@link #loadHtmlTemplate(InputStream)} but if fail to
parse xhtml, throws Mixer2JAXBException.

@see #loadHtmlTemplate(InputStream)
@param inputStream
@return html tag object.
@throws IOException
@throws Mixer2JAXBException
161291
public Html checkAndLoadHtmlTemplate(InputStream inputStream)
            throws IOException, Mixer2JAXBException {
        StringBuilder sb = inputStreamToStringBuilder(inputStream);
        return checkAndLoadHtmlTemplate(sb);
    }
188427
@Override
	final public void doTag() throws JspException, IOException {
		try {
			// The output type cannot be determined until the body of the tag is invoked, because nested tags may
			// alter the resulting type.  We invoke the body first to accommodate nested tags.
			JspFragment body = getJspBody();
			if(body!=null) body.invoke(NullWriter.getInstance());

			MediaType myOutputType = getOutputType();
			if(myOutputType==null) {
				// No output, error if anything written.
				// prefix skipped
				doTag(FailOnWriteWriter.getInstance());
				// suffix skipped
			} else {
				final PageContext pageContext = (PageContext)getJspContext();
				final ServletRequest request = pageContext.getRequest();
				final HttpServletResponse response = (HttpServletResponse)pageContext.getResponse();
				final Writer out = pageContext.getOut();

				final ThreadEncodingContext parentEncodingContext = ThreadEncodingContext.getCurrentContext(request);

				// Determine the container's content type
				MediaType containerContentType;
				if(parentEncodingContext != null) {
					// Use the output type of the parent
					containerContentType = parentEncodingContext.contentType;
				} else {
					// Use the content type of the response
					String responseContentType = response.getContentType();
					// Default to XHTML: TODO: Is there a better way since can't set content type early in response then reset again...
					if(responseContentType == null) responseContentType = MediaType.XHTML.getContentType();
					containerContentType = MediaType.getMediaTypeForContentType(responseContentType);
				}

				// Determine the validator for the parent type.  This is to make sure prefix and suffix are valid.
				Writer containerValidator;
				if(parentEncodingContext != null) {
					// Make sure the output is compatibly validated.  It is a bug in the parent to not validate its input consistent with its content type
					if(!parentEncodingContext.validMediaInput.isValidatingMediaInputType(containerContentType)) {
						throw new LocalizedJspTagException(
							ApplicationResources.accessor,
							"AutoEncodingFilterTag.parentIncompatibleValidation",
							parentEncodingContext.validMediaInput.getClass().getName(),
							containerContentType.getContentType()
						);
					}
					// Already validated
					containerValidator = out;
				} else {
					// Need to add validator
					containerValidator = MediaValidator.getMediaValidator(containerContentType, out);
				}

				// Write any prefix
				writePrefix(containerContentType, containerValidator);

				// Find the encoder
				MediaEncoder mediaEncoder = MediaEncoder.getInstance(new HttpServletResponseEncodingContext(response), myOutputType, containerContentType);
				if(mediaEncoder!=null) {
					setMediaEncoderOptions(mediaEncoder);
					// Encode our output.  The encoder guarantees valid output for our parent.
					MediaWriter mediaWriter = new MediaWriter(mediaEncoder, out);
					mediaWriter.writePrefix();
					try {
						ThreadEncodingContext.setCurrentContext(
							request,
							new ThreadEncodingContext(myOutputType, mediaWriter)
						);
						try {
							doTag(mediaWriter);
						} finally {
							// Restore previous encoding context that is used for our output
							ThreadEncodingContext.setCurrentContext(request, parentEncodingContext);
						}
					} finally {
						mediaWriter.writeSuffix();
					}
				} else {
					// If parentValidMediaInput exists and is validating our output type, no additional validation is required
					if(
						parentEncodingContext != null
						&& parentEncodingContext.validMediaInput.isValidatingMediaInputType(myOutputType)
					) {
						ThreadEncodingContext.setCurrentContext(
							request,
							new ThreadEncodingContext(myOutputType, parentEncodingContext.validMediaInput)
						);
						try {
							doTag(out);
						} finally {
							ThreadEncodingContext.setCurrentContext(request, parentEncodingContext);
						}
					} else {
						// Not using an encoder and parent doesn't validate our output, validate our own output.
						MediaValidator validator = MediaValidator.getMediaValidator(myOutputType, out);
						ThreadEncodingContext.setCurrentContext(
							request,
							new ThreadEncodingContext(myOutputType, validator)
						);
						try {
							doTag(validator);
						} finally {
							ThreadEncodingContext.setCurrentContext(request, parentEncodingContext);
						}
					}
				}

				// Write any suffix
				writeSuffix(containerContentType, containerValidator);
			}
		} catch(MediaException err) {
			throw new JspTagException(err);
		}
	}
62927
public static HttpTemplate template(TemplateType type, String template) {
        return new HttpTemplate(type).withTemplate(template);
    }
213443
public Template getTemplate(String name) throws IOException, ParseException {
        return getTemplate(name, null, null, null);
    }
1039544
@SafeVarargs
    public static <S, E extends Event> InputMapTemplate<S, E> sequence(InputMapTemplate<S, ? extends E>... templates) {
        return new TemplateChain<>(templates);
    }
924208
public static InputStream inputStream(URL url) {
        try {
            return url.openStream();
        } catch (IOException e) {
            throw E.ioException(e);
        }
    }
1160136
private RegionMetadata loadFromStream(final InputStream stream) {
        try {
            return LegacyRegionXmlLoadUtils.load(stream);
        } catch (IOException exception) {
            throw new SdkClientException(
                    "Error parsing region metadata from input stream",
                    exception);
        }
    }
17658
public void parseStreamPrintHtml(PrintWriter out, InputStream streamIn)
    {
        XMLParser parser = ((BaseParserScreen)this.getScreenField()).getXMLParser();
        if (parser != null)
        {
            parser.printHtmlData(out, streamIn);
            parser.free();
            parser = null;
        }
        else
        {
            Utility.transferURLStream(null, null, new InputStreamReader(streamIn), out);
        }
    }
1094053
public Object parse(InputStream inputStream, String charset) {
        if (inputStream == null) {
            throw new IllegalArgumentException("inputStream must not be null");
        }
        if (charset == null) {
            throw new IllegalArgumentException("charset must not be null");
        }

        Object content;
        content = createParser().parse(inputStream, charset);
        return content;
    }
130880
public static String tagHtmlContent(String tag, String... content) {
		return openTagHtmlContent(tag, null, null, content) + closeTag(tag);
	}
1143085
private Properties loadLegacyTokenProperties(InputStream inputStream) throws JinxException {
    Properties p = new Properties();
    try {
      p.loadFromXML(inputStream);
    } catch (Exception e) {
      throw new JinxException("Unable to load data from input stream.", e);
    }
    return p;
  }
817181
public void loadFromYAML(final InputStream is) throws IOException {
		lock.writeLock().lock();
		try {
			final YAMLFactory f = new YAMLFactory();
			final YAMLParser jp = f.createParser(is);
			configureJsonParser(jp);
			if (jp.nextToken() == JsonToken.START_OBJECT) {
				traverseJSON(jp, null);
			}
		} finally {
			lock.writeLock().unlock();
		}
	}
46782
private StringBuffer loadScriptTemplate() {
		try (InputStream is = ClassLoaderResourceUtils.getResourceAsStream(SCRIPT_TEMPLATE, this);
				StringWriter sw = new StringWriter()) {
			IOUtils.copy(is, sw);
			return sw.getBuffer();

		} catch (IOException e) {
			Marker fatal = MarkerFactory.getMarker("FATAL");
			LOGGER.error(fatal, "a serious error occurred when initializing MessageBundleScriptCreator");
			throw new BundlingProcessException(
					"Classloading issues prevent loading the message template to be loaded. ", e);
		}
	}
726612
@Override
	public void load(final InputStream inStream) throws IOException {
		lock.writeLock().lock();
		try {
			properties.load(inStream);
		} finally {
			lock.writeLock().unlock();
		}
	}
236589
@Override
    public InputStream openStream() {
        StringBuilder content = new StringBuilder();
        for (String providerImpl : providerImpls) {
            content.append(providerImpl).append('\n');
        }
        return new ByteArrayInputStream(content.toString().getBytes());
    }
1253105
private StringBuffer loadScriptTemplate(String path) {
		StringWriter sw = new StringWriter();

		InputStream is = null;
		try {
			is = ClassLoaderResourceUtils.getResourceAsStream(path, this);
			int i;
			while ((i = is.read()) != -1) {
				sw.write(i);
			}

		} catch (IOException e) {
			Marker fatal = MarkerFactory.getMarker("FATAL");
			LOGGER.error(fatal, "a serious error occurred when initializing ClientSideHandlerGeneratorImpl");
			throw new BundlingProcessException("Classloading issues prevent loading the loader template to be loaded. ",
					e);
		} finally {
			IOUtils.close(is);
		}

		return sw.getBuffer();
	}
393935
public static Document parseXmlStream(final Reader xmlStream) {

        // Build a DOM model of the provided xmlFileStream.
        final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        factory.setNamespaceAware(true);

        try {
            return factory.newDocumentBuilder().parse(new InputSource(xmlStream));
        } catch (Exception e) {
            throw new IllegalArgumentException("Could not acquire DOM Document", e);
        }
    }