A utility method to print this source tree to the given stream.
506730
public void printSource(Source src, PrintStream out)
    {
        TransformerFactory tFact = TransformerFactory.newInstance();
        try {
            Transformer transformer = tFact.newTransformer();

            Result result = new StreamResult( out );
            transformer.transform(src, result);
        } catch (TransformerConfigurationException ex)  {
            ex.printStackTrace();
        } catch (TransformerException ex)  {
            ex.printStackTrace();
        }
    }
327463
public static void print(PrintStream out, String xpath, Object result){
        out.printf("XPath: %s%n", xpath);
        print(out, result, 2);
    }
538445
private <T extends URNIdentified> Stream<T> sortStreamLexicographically(Stream<T> inputStream) {
    Spliterator<T> spliterator = inputStream.spliterator();
    if (spliterator.hasCharacteristics(Spliterator.SORTED) && spliterator.getComparator()
        .equals(this.lexicographicalComparator)) {
      return StreamSupport.stream(spliterator, false);
    }
    return StreamSupport.stream(spliterator, false).sorted(this.lexicographicalComparator);
  }
301873
public Stream<FlatTreeNode<T>> stream() {
		return IntStream.range(0, _nodes.size()).mapToObj(this::nodeAt);
	}
917527
public static void printHelp(PrintStream stream) throws IOException {
            stream.println();
            stream.println("NAME");
            stream.println("  meta get - Get metadata from nodes");
            stream.println();
            stream.println("SYNOPSIS");
            stream.println("  meta get (<meta-key-list> | all) -u <url> [-d <output-dir>]");
            stream.println("           [-n <node-id-list> | --all-nodes] [--verbose]");
            stream.println();
            stream.println("COMMENTS");
            stream.println("  Valid meta keys are:");
            for(Object key: MetadataStore.METADATA_KEYS) {
                stream.println("    " + (String) key);
            }
            stream.println();
            getParser().printHelpOn(stream);
            stream.println();
        }
51293
private PrintStream newStream(String name) throws IOException {
    if(LOG.isDebuggingFiner()) {
      LOG.debugFiner("Requested stream: " + name);
    }
    // Ensure the directory exists:
    if(!basename.exists()) {
      basename.mkdirs();
    }
    String fn = basename.getAbsolutePath() + File.separator + name + EXTENSION;
    fn = usegzip ? fn + GZIP_EXTENSION : fn;
    OutputStream os = new FileOutputStream(fn);
    if(usegzip) {
      // wrap into gzip stream.
      os = new GZIPOutputStream(os);
    }
    PrintStream res = new PrintStream(os);
    if(LOG.isDebuggingFiner()) {
      LOG.debugFiner("Opened new output stream:" + fn);
    }
    // cache.
    return res;
  }
1337492
private OutputStream initializeSource()
    {
    try
      {
      PipedOutputStream pipeOut = new PipedOutputStream();
      PipedInputStream pipeIn = new PipedInputStream( pipeOut);

      filterInput_ = pipeIn;
      return new FilterSourceStream( pipeOut);
      }
    catch( Exception e)
      {
      throw new RuntimeException( "Can't initialize source stream", e);
      }
    }
1336401
private static <T extends GraphNode<T>> StringBuilder printTree(T node, Formatter<T> formatter,
                                                                    String indent, StringBuilder sb,
                                                                    Predicate<T> nodeFilter,
                                                                    Predicate<T> subTreeFilter) {
        if (nodeFilter.apply(node)) {
            String line = formatter.format(node);
            if (line != null) {
                sb.append(indent).append(line).append("\n");
                indent += "  ";
            }
        }
        if (subTreeFilter.apply(node)) {
            for (T sub : node.getChildren()) {
                printTree(sub, formatter, indent, sb, nodeFilter, subTreeFilter);
            }
        }
        return sb;
    }
1366531
@Override
    public <T extends TreeNode> T readTree(JsonParser p) throws IOException {
        if (_treeCodec == null) {
            _noTreeCodec("write TreeNode");
        }
        return _treeCodec.readTree(p);
    }
468684
private void readObject(java.io.ObjectInputStream s)
        throws java.io.IOException, ClassNotFoundException {
        // Read in any hidden stuff
        s.defaultReadObject();

        // Read in Comparator
        @SuppressWarnings("unchecked")
            Comparator<? super E> c = (Comparator<? super E>) s.readObject();

        // Create backing TreeMap
        TreeMap<E,Object> tm = new TreeMap<>(c);
        m = tm;

        // Read in size
        int size = s.readInt();

        tm.readTreeSet(size, s, PRESENT);
    }
14275
private PrintStream getPrimaryStream(boolean showError) {
        File primaryFile = getPrimaryFile();
        setStreamFromFile(primaryFile, false, primaryFile.length(), showError);
        return currentPrintStream;
    }
462756
public static void printHelp(PrintStream stream) throws IOException {
            stream.println();
            stream.println("NAME");
            stream.println("  meta get-ro - Get read-only metadata from nodes and stores");
            stream.println();
            stream.println("SYNOPSIS");
            stream.println("  meta get-ro (<ro-meta-key-list> | all) -s <store-name-list> -u <url>");
            stream.println("              [-n <node-id-list> | --all-nodes]");
            stream.println();
            stream.println("COMMENTS");
            stream.println("  Valid read-only meta keys are:");
            stream.println("    " + KEY_MAX_VERSION);
            stream.println("    " + KEY_CURRENT_VERSION);
            stream.println("    " + KEY_STORAGE_FORMAT);
            stream.println();
            getParser().printHelpOn(stream);
            stream.println();
        }
476344
@GwtIncompatible("Unnecessary")
  private Writer streamToLegacyOutputWriter(OutputStream stream) throws IOException {
    if (legacyOutputCharset == null) {
      return new BufferedWriter(new OutputStreamWriter(stream, UTF_8));
    } else {
      return new BufferedWriter(
          new OutputStreamWriter(stream, legacyOutputCharset));
    }
  }
1266266
@Override
    public void to(final NodeDescriptor descriptor, final OutputStream output) throws DescriptorExportException,
        IllegalArgumentException {
        // Precondition checks
        if (descriptor == null) {
            throw new IllegalArgumentException("descriptor must be specified");
        }
        if (output == null) {
            throw new IllegalArgumentException("stream must be specified");
        }

        // Get the root node
        final Node root = descriptor.getRootNode();

        // Delegate
        this.to(root, output);
    }
1100081
private void print(String s, OutputStream ostream) throws IOException
   {
      int length = s.length();
      for (int i = 0; i < length; i++)
      {
         char c = s.charAt(i);
         ostream.write(c);
      }
   }
1195273
def pprint(self, ind):
        """"""
        pp = pprint.PrettyPrinter(indent=ind)
        pp.pprint(self.tree)
1059881
public void dump(PrintStream out)
    {
        out.println(this+":");
        out.println(super.toString());
        out.println(_roles);
    }