private static void writeFormatData(ContinuableRecordOutput out, HSSFRichTextString str) {
   int nRuns = str.numFormattingRuns();
   for (int i = 0; i < nRuns; i++) {
     out.writeShort(str.getIndexOfFormattingRun(i));
     int fontIndex = str.getFontOfFormattingRun(i);
     out.writeShort(fontIndex == str.NO_FONT ? 0 : fontIndex);
     out.writeInt(0); // skip reserved
   }
   out.writeShort(str.length());
   out.writeShort(0);
   out.writeInt(0); // skip reserved
 }
  private void serializeTXORecord(ContinuableRecordOutput out) {

    out.writeShort(field_1_options);
    out.writeShort(field_2_textOrientation);
    out.writeShort(field_3_reserved4);
    out.writeShort(field_4_reserved5);
    out.writeShort(field_5_reserved6);
    out.writeShort(_text.length());
    out.writeShort(getFormattingDataLength());
    out.writeInt(field_8_reserved7);

    if (_linkRefPtg != null) {
      int formulaSize = _linkRefPtg.getSize();
      out.writeShort(formulaSize);
      out.writeInt(_unknownPreFormulaInt);
      _linkRefPtg.write(out);
      if (_unknownPostFormulaByte != null) {
        out.writeByte(_unknownPostFormulaByte.byteValue());
      }
    }
  }