text: public void WriteString(String text, int numberOfRichTextRuns, int extendedDataSize){bool is16bitEncoded = StringUtil.HasMultibyte(text);int keepTogetherSize = 2 + 1 + 1; int optionFlags = 0x00;if (is16bitEncoded){optionFlags |= 0x01;keepTogetherSize += 1; }if (numberOfRichTextRuns > 0){optionFlags |= 0x08;keepTogetherSize += 2;}if (extendedDataSize > 0){optionFlags |= 0x04;keepTogetherSize += 4;}WriteContinueIfRequired(keepTogetherSize);WriteShort(text.Length);WriteByte(optionFlags);if (numberOfRichTextRuns > 0){WriteShort(numberOfRichTextRuns);}if (extendedDataSize > 0){WriteInt(extendedDataSize);}WriteCharacterData(text, is16bitEncoded);}