text: public void writeString(String text, int numberOfRichTextRuns, int extendedDataSize) {boolean 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);}