View | Details | Raw Unified | Return to bug 47847
Collapse All | Expand All

(-)src/java/org/apache/poi/hssf/record/UnicodeString.java (-10 / +5 lines)
Lines 37-42 Link Here
37
 * @author  Andrew C. Oliver
37
 * @author  Andrew C. Oliver
38
 * @author Marc Johnson (mjohnson at apache dot org)
38
 * @author Marc Johnson (mjohnson at apache dot org)
39
 * @author Glen Stampoultzis (glens at apache.org)
39
 * @author Glen Stampoultzis (glens at apache.org)
40
 * @author Pierre Tholence
40
 */
41
 */
41
public final class UnicodeString implements Comparable<UnicodeString> {
42
public final class UnicodeString implements Comparable<UnicodeString> {
42
    private short             field_1_charCount;
43
    private short             field_1_charCount;
Lines 485-500 Link Here
485
            // OK ExtRst is actually not documented, so i am going to hope
486
            // OK ExtRst is actually not documented, so i am going to hope
486
            // that we can actually continue on byte boundaries
487
            // that we can actually continue on byte boundaries
487
488
488
            int extPos = 0;
489
            // This assumption was wrong it seems that if we break the
489
            while (true) {
490
            // ExtRst field the resulting file is corrupted
490
                int nBytesToWrite = Math.min(extendedDataSize - extPos, out.getAvailableSpace());
491
491
                out.write(field_5_ext_rst, extPos, nBytesToWrite);
492
            out.write(field_5_ext_rst);
492
                extPos += nBytesToWrite;
493
                if (extPos >= extendedDataSize) {
494
                    break;
495
                }
496
                out.writeContinue();
497
            }
498
        }
493
        }
499
    }
494
    }
500
495

Return to bug 47847