Writes the document

@param out The <code>OutputStream</code> to write the RTF document to.
359422
public void writeDocument(OutputStream out) {
        try {
            out.write(OPEN_GROUP);
            out.write(RtfDocument.RTF_DOCUMENT);
            this.documentHeader.writeContent(out);
            this.data.writeTo(out);
            out.write(CLOSE_GROUP);
        } catch(IOException ioe) {
            ioe.printStackTrace();
        }
    }
640751
public static void writeToOutputStream(String s, OutputStream output) throws IOException {
		writeToOutputStream(s, output, null);
	}
307174
public void writeContent(final OutputStream result) throws IOException
    {
        result.write(OPEN_GROUP);
        if(this.type == TYPE_HEADER) {
            if(this.displayAt == DISPLAY_ALL_PAGES) {
                result.write(HEADER_ALL);
            } else if(this.displayAt == DISPLAY_FIRST_PAGE) {
                result.write(HEADER_FIRST);
            } else if(this.displayAt == DISPLAY_LEFT_PAGES) {
                result.write(HEADER_LEFT);
            } else if(this.displayAt == DISPLAY_RIGHT_PAGES) {
                result.write(HEADER_RIGHT);
            }
        } else {
            if(this.displayAt == DISPLAY_ALL_PAGES) {
                result.write(FOOTER_ALL);
            } else if(this.displayAt == DISPLAY_FIRST_PAGE) {
                result.write(FOOTER_FIRST);
            } else if(this.displayAt == DISPLAY_LEFT_PAGES) {
                result.write(FOOTER_LEFT);
            } else if(this.displayAt == DISPLAY_RIGHT_PAGES) {
                result.write(FOOTER_RIGHT);
            }
        }
        result.write(DELIMITER);
        for(int i = 0; i < this.content.length; i++) {
            if(this.content[i] instanceof RtfBasicElement) {
            	RtfBasicElement rbe = (RtfBasicElement)this.content[i];
            	rbe.writeContent(result);
            }
        }
        result.write(CLOSE_GROUP);
    }
843640
public void dump(OutputStream out){
        hydrate();
        PrintWriter p = new PrintWriter(out);
        for(Model m : delegate){
            p.write(m.toString());
            p.write('\n');
        }
        p.flush();
    }
636274
public void writeContent(final OutputStream result) throws IOException
    {
        this.font.writeBegin(result);
        writeFieldBegin(result);
        writeFieldInstBegin(result);
        writeFieldInstContent(result);
        writeFieldInstEnd(result);
        writeFieldResultBegin(result);
        writeFieldResultContent(result);
        writeFieldResultEnd(result);
        writeFieldEnd(result);
        this.font.writeEnd(result);
    }
545023
public void writeTo (ObjectOutputStream out)
        throws IOException
    {
        out.writeShort(_mask.length);
        out.write(_mask);
    }
296544
protected void writePdf(final MBasicTable table, final OutputStream out) throws IOException {
		try {
			// step 1: creation of a document-object
			final Rectangle pageSize = landscape ? PageSize.A4.rotate() : PageSize.A4;
			final Document document = new Document(pageSize, 50, 50, 50, 50);
			// step 2: we create a writer that listens to the document and directs a PDF-stream to out
			createWriter(table, document, out);

			// we add some meta information to the document, and we open it
			document.addAuthor(System.getProperty("user.name"));
			document.addCreator("JavaMelody");
			final String title = buildTitle(table);
			if (title != null) {
				document.addTitle(title);
			}
			document.open();

			// ouvre la boîte de dialogue Imprimer de Adobe Reader
			// if (writer instanceof PdfWriter) {
			// ((PdfWriter) writer).addJavaScript("this.print(true);", false);
			// }

			// table
			final Table datatable = new Table(table.getColumnCount());
			datatable.setCellsFitPage(true);
			datatable.setPadding(4);
			datatable.setSpacing(0);

			// headers
			renderHeaders(table, datatable);

			// data rows
			renderList(table, datatable);

			document.add(datatable);

			// we close the document
			document.close();
		} catch (final DocumentException e) {
			// on ne peut déclarer d'exception autre que IOException en throws
			throw new IOException(e);
		}
	}
1368019
public void write(Writer out)
         throws IOException
    {
        out.write("<!--\n");
        super.write(out);
        out.write("\n-->");
    }
403386
public final void writeTo(String fmt, OutputStream out) throws IOException {
        if (fmt.equalsIgnoreCase(SVG_FMT)) {
            out.write(toSvgStr().getBytes(Charsets.UTF_8));
        } else if (fmt.equalsIgnoreCase(PS_FMT)) {
            out.write(toEpsStr().getBytes(Charsets.UTF_8));
        } else if (fmt.equalsIgnoreCase(PDF_FMT)) {
            out.write(toPdfStr().getBytes(Charsets.UTF_8));
        } else {
            ImageIO.write(toImg(), fmt, out);
        }
    }
942976
public static void writeDocumentToOutputStream(DomDocument document, OutputStream outputStream) {
    StreamResult result = new StreamResult(outputStream);
    transformDocumentToXml(document, result);
  }
162209
public static void writeObjectToStream(final Object o, OutputStream out) {
    out = new BufferedOutputStream(out);
    try {
      final ObjectOutputStream oos = new ObjectOutputStream(out);
      oos.writeObject(o);
      oos.flush();
    } catch (final IOException e) {
      e.printStackTrace();
    }
  }
41393
public static void write(OutputStream out, boolean isCloseOut, byte[] content) throws IORuntimeException {
		try {
			out.write(content);
		} catch (IOException e) {
			throw new IORuntimeException(e);
		} finally {
			if (isCloseOut) {
				close(out);
			}
		}
	}
142136
public final void serialize(OutputStream out) throws IOException {
        out.write(Jackson.toJsonString(this).getBytes(UTF8));
        out.flush();
    }
324978
public void write(OutputStream out) throws IOException
    {
        if (log.isTraceEnabled())
            log.trace("AJP13 snd: "+this.toString(64));
        // System.err.println(Thread.currentThread()+" AJP13 snd
        // "+this.toString());
        out.write(_buf,0,_bytes);
    }
485303
public void writeContent(final OutputStream result) throws IOException
    {
        try {
            // This is so that all color, font and similar information is processed once, before
            // the header section is written.
            writeSectionDefinition(new RtfNilOutputStream());
            
            this.codePage.writeDefinition(result);
            this.fontList.writeDefinition(result);
            this.colorList.writeDefinition(result);
            this.stylesheetList.writeDefinition(result);
            this.listTable.writeDefinition(result);
            this.generator.writeContent(result);
            this.infoGroup.writeContent(result);
            this.protectionSetting.writeDefinition(result);
            this.pageSetting.writeDefinition(result);
            
            writeSectionDefinition(result);
        } catch(IOException ioe) {
            ioe.printStackTrace();
        }
    }
963207
public File writeToStream(OutputStream out) throws IORuntimeException {
		FileInputStream in = null;
		try {
			in = new FileInputStream(file);
			IoUtil.copy(in, out);
		}catch (IOException e) {
			throw new IORuntimeException(e);
		} finally {
			IoUtil.close(in);
		}
		return this.file;
	}
778439
public void serialize(final OutputStream out) throws IOException {
    final Writer writer = new BufferedWriter(new OutputStreamWriter(out));
    for (final Map.Entry<String, String> entry : this.multiMap.entries()) {
      writer.write(
          entry.getKey() + IOUtils.TAB_DELIMITER + entry.getValue() + "\n");
    }
    writer.flush();
  }