Writes the start information of this RtfParagraphStyle.

@param result The <code>OutputStream</code> to write to.
@throws IOException On i/o errors.
357518
public void writeBegin(final OutputStream result) throws IOException {
        result.write(DocWriter.getISOBytes("\\s"));
        result.write(intToByteArray(this.styleNumber));
        writeParagraphSettings(result);
    }
343936
public void writeSectionDefinition(final OutputStream result) 
    {
        try {
            RtfHeaderFooterGroup header = convertHeaderFooter(this.header, RtfHeaderFooter.TYPE_HEADER);
            RtfHeaderFooterGroup footer = convertHeaderFooter(this.footer, RtfHeaderFooter.TYPE_FOOTER);
            if(header.hasTitlePage() || footer.hasTitlePage()) {
                result.write(TITLE_PAGE);
                header.setHasTitlePage();
                footer.setHasTitlePage();
            }
            if(header.hasFacingPages() || footer.hasFacingPages()) {
                result.write(FACING_PAGES);
                header.setHasFacingPages();
                footer.setHasFacingPages();
            }
            footer.writeContent(result);
            header.writeContent(result);
            pageSetting.writeSectionDefinition(result);
        } catch(IOException ioe) {
            ioe.printStackTrace();
        }    	
    }
82436
public void writeContent(final OutputStream result) throws IOException
    {
        result.write(PARAGRAPH_DEFAULTS);
        result.write(PLAIN);
        if(inTable) {
            result.write(IN_TABLE);
        }
        if(this.lineLeading > 0) {
            result.write(LINE_SPACING);
            result.write(intToByteArray(this.lineLeading));
        }
        for(int i = 0; i < chunks.size(); i++) {
        	RtfBasicElement rbe = (RtfBasicElement) chunks.get(i);
        	rbe.writeContent(result);
        }
    }
434869
@Override
  //@Direct
  public void openWrite(Result<OutputStream> result,
                        WriteOption ...options)
  {
    result.ok(_root.openWriteFile(_path, options));
  }
619758
public void writeContent(final OutputStream result) throws IOException
    {
        if(this.content.size() == 0) {
            result.write(RtfParagraph.PARAGRAPH_DEFAULTS);
            if(this.parentRow.getParentTable().getTableFitToPage()) {
                result.write(RtfParagraphStyle.KEEP_TOGETHER_WITH_NEXT);
            }
            result.write(RtfParagraph.IN_TABLE);
        } else {
            for(int i = 0; i < this.content.size(); i++) {
                RtfBasicElement rtfElement = (RtfBasicElement) this.content.get(i);
                if(rtfElement instanceof RtfParagraph) {
                    ((RtfParagraph) rtfElement).setKeepTogetherWithNext(this.parentRow.getParentTable().getTableFitToPage());
                }
                rtfElement.writeContent(result);
                if(rtfElement instanceof RtfParagraph && i < (this.content.size() - 1)) {
                    result.write(RtfParagraph.PARAGRAPH);
                }
            }
        }
        result.write(DocWriter.getISOBytes("\\cell"));
    }
726131
public void writeContent(final OutputStream result) throws IOException
    {    	
    	result.write(DocWriter.getISOBytes("\\shpleft"));
    	result.write(intToByteArray(this.left));
    	result.write(DocWriter.getISOBytes("\\shptop"));
    	result.write(intToByteArray(this.top));
    	result.write(DocWriter.getISOBytes("\\shpright"));
    	result.write(intToByteArray(this.right));
    	result.write(DocWriter.getISOBytes("\\shpbottom"));
    	result.write(intToByteArray(this.bottom));
    	result.write(DocWriter.getISOBytes("\\shpz"));
    	result.write(intToByteArray(this.zOrder));
    	switch(this.xRelativePos) {
    	case POSITION_X_RELATIVE_PAGE: result.write(DocWriter.getISOBytes("\\shpbxpage")); break;
    	case POSITION_X_RELATIVE_MARGIN: result.write(DocWriter.getISOBytes("\\shpbxmargin")); break;
    	case POSITION_X_RELATIVE_COLUMN: result.write(DocWriter.getISOBytes("\\shpbxcolumn")); break;
    	}
    	if(this.ignoreXRelative) {
    		result.write(DocWriter.getISOBytes("\\shpbxignore"));
    	}
    	switch(this.yRelativePos) {
    	case POSITION_Y_RELATIVE_PAGE: result.write(DocWriter.getISOBytes("\\shpbypage")); break;
    	case POSITION_Y_RELATIVE_MARGIN: result.write(DocWriter.getISOBytes("\\shpbymargin")); break;
    	case POSITION_Y_RELATIVE_PARAGRAPH: result.write(DocWriter.getISOBytes("\\shpbypara")); break;
    	}
    	if(this.ignoreYRelative) {
    		result.write(DocWriter.getISOBytes("\\shpbyignore"));
    	}
    	if(this.shapeBelowText) {
    		result.write(DocWriter.getISOBytes("\\shpfblwtxt1"));
    	} else {
    		result.write(DocWriter.getISOBytes("\\shpfblwtxt0"));
    	}
    }
19103
public void writeSectionDefinition(final OutputStream result) throws IOException
    {
        if(landscape) {
            result.write(LANDSCAPE);
            result.write(SECTION_PAGE_WIDTH);
            result.write(intToByteArray(pageWidth));
            result.write(SECTION_PAGE_HEIGHT);
            result.write(intToByteArray(pageHeight));
            this.document.outputDebugLinebreak(result);
        } else {
            result.write(SECTION_PAGE_WIDTH);
            result.write(intToByteArray(pageWidth));
            result.write(SECTION_PAGE_HEIGHT);
            result.write(intToByteArray(pageHeight));
            this.document.outputDebugLinebreak(result);
        }
        result.write(SECTION_MARGIN_LEFT);
        result.write(intToByteArray(marginLeft));
        result.write(SECTION_MARGIN_RIGHT);
        result.write(intToByteArray(marginRight));
        result.write(SECTION_MARGIN_TOP);
        result.write(intToByteArray(marginTop));
        result.write(SECTION_MARGIN_BOTTOM);
        result.write(intToByteArray(marginBottom));    	
    }
634954
public void writeBegin(final OutputStream result) {
        try {
            result.write(COLOR_NUMBER);
            result.write(intToByteArray(colorNumber));
        } catch(IOException ioe) {
            ioe.printStackTrace();
        }
    }
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);
    }
465560
public void writeDefinition(final OutputStream result) throws IOException
    {
        result.write(OPEN_GROUP);
        result.write(LIST);
        result.write(LIST_TEMPLATE_ID);
        result.write(intToByteArray(document.getRandomInt()));

        int levelsToWrite = -1;
        
        switch(this.listType) {
        case LIST_TYPE_NORMAL:
        	levelsToWrite = listLevels.size();
        	break;
        case LIST_TYPE_SIMPLE:
            result.write(LIST_SIMPLE);
            result.write(intToByteArray(1)); 
        	levelsToWrite = 1;
        	break;
        case LIST_TYPE_HYBRID:
            result.write(LIST_HYBRID);
        	levelsToWrite = listLevels.size();
        	break;
    	default:
    		break;
        }
        this.document.outputDebugLinebreak(result);

        // TODO: Figure out hybrid because multi-level hybrid does not work.
        // Seems hybrid is mixed type all single level - Simple = single level
        // SIMPLE1/HYRBID
        // 1. Line 1
        // 2. Line 2
        // MULTI-LEVEL LISTS Are Simple0 - 9 levels (0-8) all single digit
        // 1. Line 1
        // 1.1. Line 1.1
        // 1.2. Line 1.2
        // 2. Line 2
         
        // write the listlevels here
        for(int i = 0; i<levelsToWrite; i++) {
        	((RtfListLevel)listLevels.get(i)).writeDefinition(result);
            this.document.outputDebugLinebreak(result);
        }
        
        result.write(LIST_ID);
        result.write(intToByteArray(this.listID));
        result.write(CLOSE_GROUP);
        this.document.outputDebugLinebreak(result);
        if(items != null) {
        for(int i = 0; i < items.size(); i++) {
            RtfElement rtfElement = (RtfElement) items.get(i);
            if(rtfElement instanceof RtfList) {
            	RtfList rl = (RtfList)rtfElement;
            	rl.writeDefinition(result);
                break;
            } else if(rtfElement instanceof RtfListItem) {
            	RtfListItem rli = (RtfListItem) rtfElement;
            	if(rli.writeDefinition(result)) break;
            }
        }    
        }
    }
1123396
public static void write(final String data, final OutputStream output) throws IOException {
		if (data != null) {
			output.write(data.getBytes(Charsets.UTF_8));
		}
	}
577307
public void writeListBeginning(final OutputStream result) throws IOException {
        result.write(RtfParagraph.PARAGRAPH_DEFAULTS);
        if(this.inTable) {
            result.write(RtfParagraph.IN_TABLE);
        }
        switch (this.alignment) {
            case Element.ALIGN_LEFT:
                result.write(RtfParagraphStyle.ALIGN_LEFT);
                break;
            case Element.ALIGN_RIGHT:
                result.write(RtfParagraphStyle.ALIGN_RIGHT);
                break;
            case Element.ALIGN_CENTER:
                result.write(RtfParagraphStyle.ALIGN_CENTER);
                break;
            case Element.ALIGN_JUSTIFIED:
            case Element.ALIGN_JUSTIFIED_ALL:
                result.write(RtfParagraphStyle.ALIGN_JUSTIFY);
                break;
        }
        writeIndentation(result);
        result.write(RtfFont.FONT_SIZE);
        result.write(intToByteArray(fontNumber.getFontSize() * 2));
        if(this.symbolIndent > 0) {
            result.write(LIST_LEVEL_SYMBOL_INDENT);
            result.write(intToByteArray(this.leftIndent));
        }
    }
1194715
public void write(final OutputStream out) throws IOException {
        if (this.byteOrder == ByteOrder.BIG_ENDIAN) {
            out.write(MAGIC_BIG_ENDIAN);
        } else {
            out.write(MAGIC_LITTLE_ENDIAN);
        }
        out.write(this.body);
    }
122688
public void writeContent(final OutputStream result) throws IOException
    {
    	result.write(OPEN_GROUP);
		result.write(INFO_GROUP);
		for(int i = 0; i < infoElements.size(); i++) {
			RtfInfoElement infoElement = (RtfInfoElement) infoElements.get(i);
			infoElement.writeContent(result);
		}
		
		// handle document protection
    	if(document.getDocumentSettings().isDocumentProtected()) {
	    	result.write(OPEN_GROUP);
			result.write(INFO_PASSWORD);
			result.write(DELIMITER);
			result.write(document.getDocumentSettings().getProtectionHashBytes());
			result.write(CLOSE_GROUP);
    	}

		result.write(CLOSE_GROUP);
		this.document.outputDebugLinebreak(result);
    }
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();
        }
    }
580884
public void writeResult(Map<BioPAXElement, List<Match>> matches, OutputStream out)
		throws IOException
	{
		writeResultDetailed(matches, out, 5);
	}
732595
public void writeContent(final OutputStream result) throws IOException
    {
    	switch(this.type) {
    		case TAB_CENTER_ALIGN: result.write(DocWriter.getISOBytes("\\tqc")); break;
    		case TAB_RIGHT_ALIGN: result.write(DocWriter.getISOBytes("\\tqr")); break;
    		case TAB_DECIMAL_ALIGN: result.write(DocWriter.getISOBytes("\\tqdec")); break;
        }
        result.write(DocWriter.getISOBytes("\\tx"));
        result.write(intToByteArray(this.position));    	
    }