wffweb/src/main/java/com/webfirmframework/wffweb/tag/html/AbstractHtml.java
private static void recurChildrenToOutputStream(final int[] totalWritten,
            final Charset charset, final OutputStream os,
            final Set<AbstractHtml> children, final boolean rebuild,
            final boolean flushOnWrite) throws IOException {

        if (children != null && children.size() > 0) {
            for (final AbstractHtml child : children) {
                child.setRebuild(rebuild);

                byte[] openingTagBytes = child.getOpeningTag()
                        .getBytes(charset);
                os.write(openingTagBytes);
                if (flushOnWrite) {
                    os.flush();
                }
                totalWritten[0] += openingTagBytes.length;
                // explicitly dereferenced right after use
                // because it's a recursive method.
                openingTagBytes = null;

                // final Set<AbstractHtml> childrenOfChildren = child.children;
                // declaring a separate local variable childrenOfChildren will
                // consume stack space so directly passed it as argument
                recurChildrenToOutputStream(totalWritten, charset, os,
                        child.children, rebuild, flushOnWrite);

                byte[] closingTagBytes = child.closingTag.getBytes(charset);
                os.write(closingTagBytes);
                if (flushOnWrite) {
                    os.flush();
                }
                totalWritten[0] += closingTagBytes.length;
                // explicitly dereferenced right after use
                // because it's a recursive method.
                closingTagBytes = null;
            }
        }
    }
private static void recurChildrenToOutputStream(final int[] totalWritten,
            final Charset charset, final OutputStream os,
            final Set<AbstractHtml> children, final boolean rebuild,
            final boolean flushOnWrite) throws IOException {

        if (children != null && children.size() > 0) {
            for (final AbstractHtml child : children) {
                child.setRebuild(rebuild);

                byte[] openingTagBytes = child.getOpeningTag()
                        .getBytes(charset);
                os.write(openingTagBytes);
                if (flushOnWrite) {
                    os.flush();
                }
                totalWritten[0] += openingTagBytes.length;
                // explicitly dereferenced right after use
                // because it's a recursive method.
                openingTagBytes = null;

                // final Set<AbstractHtml> childrenOfChildren = child.children;
                // declaring a separate local variable childrenOfChildren will
                // consume stack space so directly passed it as argument
                recurChildrenToOutputStream(totalWritten, charset, os,
                        child.children, rebuild, flushOnWrite);

                byte[] closingTagBytes = child.closingTag.getBytes(charset);
                os.write(closingTagBytes);
                if (flushOnWrite) {
                    os.flush();
                }
                totalWritten[0] += closingTagBytes.length;
                // explicitly dereferenced right after use
                // because it's a recursive method.
                closingTagBytes = null;
            }
        }
    }
to form html string from the children

@param children
@param rebuild
TODO
@param flushOnWrite
true to flush on each write to OutputStream

@since 1.0.0
@author WFF
@throws IOException