/** * {@inheritDoc} */ @Override public String toString() { ByteArrayOutputStream streamOut = new ByteArrayOutputStream(); PrintWriter writerOut = new PrintWriter(new EscapedWriter(new OutputStreamWriter(streamOut))); try { Printer.v().printTo(this, writerOut); } catch (RuntimeException e) { logger.error(e.getMessage(), e); } writerOut.flush(); writerOut.close(); return streamOut.toString(); }
/** Print a single character (unsupported). */ public void print(int ch) throws IOException { write(ch); throw new RuntimeException(); }
/** Write a segment of the given String. */ public void write(String s, int off, int len) throws IOException { for (int i = off; i < off + len; i++) { write(s.charAt(i)); } }
case Options.output_format_shimple: case Options.output_format_grimple: writerOut = new PrintWriter(new EscapedWriter(new OutputStreamWriter(streamOut))); Printer.v().printTo(c, writerOut); break; case Options.output_format_xml: writerOut = new PrintWriter(new EscapedWriter(new OutputStreamWriter(streamOut))); XMLPrinter.v().printJimpleStyleTo(c, writerOut); break;
/** Write a segment of the given String. */ public void write(String s, int off, int len) throws IOException { for(int i = off; i < off + len; i++) write(s.charAt(i)); }
/** * {@inheritDoc} */ @Override public String toString() { ByteArrayOutputStream streamOut = new ByteArrayOutputStream(); PrintWriter writerOut = new PrintWriter(new EscapedWriter(new OutputStreamWriter(streamOut))); try { Printer.v().printTo(this, writerOut); } catch (RuntimeException e) { e.printStackTrace(writerOut); } writerOut.flush(); writerOut.close(); return streamOut.toString(); } }
/** Print a single character (unsupported). */ public void print(int ch) throws IOException { write(ch); throw new RuntimeException(); }
/** * {@inheritDoc} */ @Override public String toString() { ByteArrayOutputStream streamOut = new ByteArrayOutputStream(); PrintWriter writerOut = new PrintWriter(new EscapedWriter(new OutputStreamWriter(streamOut))); try { Printer.v().printTo(this, writerOut); } catch (RuntimeException e) { e.printStackTrace(writerOut); } writerOut.flush(); writerOut.close(); return streamOut.toString(); } }
/** Print a single character (unsupported). */ public void print(int ch) throws IOException { write(ch); throw new RuntimeException(); }
/** Write a segment of the given String. */ public void write(String s, int off, int len) throws IOException { for(int i = off; i < off + len; i++) write(s.charAt(i)); }