/**
  * Compose a resource to a stream, possibly using pretty presentation for a human reader, and
  * maybe a different choice in the xhtml narrative (used in the spec in one place, but should not
  * be used in production)
  */
 public void compose(OutputStream stream, Resource resource, boolean pretty, boolean htmlPretty)
     throws Exception {
   XMLWriter writer = new XMLWriter(stream, "UTF-8");
   writer.setPretty(pretty);
   writer.start();
   compose(writer, resource, htmlPretty);
   writer.close();
 }
 /**
  * Compose a bundle to a stream, possibly using pretty presentation for a human reader (used in
  * the spec, for example, but not normally in production)
  */
 @Override
 public void compose(OutputStream stream, AtomFeed feed, boolean pretty) throws Exception {
   XMLWriter writer = new XMLWriter(stream, "UTF-8");
   writer.setPretty(pretty);
   writer.start();
   compose(writer, feed, pretty);
   writer.close();
 }
 /**
  * Compose a tag list to a stream, possibly using pretty presentation for a human reader, and
  * maybe a different choice in the xhtml narrative (used in the spec in one place, but should not
  * be used in production)
  */
 public void compose(
     OutputStream stream, List<AtomCategory> tags, boolean pretty, boolean htmlPretty)
     throws Exception {
   XMLWriter writer = new XMLWriter(stream, "UTF-8");
   writer.setPretty(pretty);
   writer.start();
   compose(writer, tags, htmlPretty);
   writer.close();
 }