try { cache.close(); } catch(IOException e) { e.printStackTrace(); }
    public void writeOn(Writer writer) {        if (cache == null) {            cache = new StringWriter();            computeIn(cache);        }        try {            writer.write(cache.toString());        } catch(IOException e) { e.printStackTrace(); }    }