Class ContinuableRecordOutput

    • Constructor Detail

      • ContinuableRecordOutput

        public ContinuableRecordOutput​(LittleEndianOutput out,
                                       int sid)
    • Method Detail

      • getTotalSize

        public int getTotalSize()
        Returns:
        total number of bytes written so far (including all BIFF headers)
      • getAvailableSpace

        public int getAvailableSpace()
        Returns:
        number of remaining bytes of space in current record
      • writeContinue

        public void writeContinue()
        Terminates the current record and starts a new ContinueRecord (regardless of how much space is still available in the current record).
      • writeContinueIfRequired

        public void writeContinueIfRequired​(int requiredContinuousSize)
        Will terminate the current record and start a new ContinueRecord if there isn't space for the requested number of bytes
        Parameters:
        requiredContinuousSize - The number of bytes that need to be written
      • writeStringData

        public void writeStringData​(String text)
        Writes the 'optionFlags' byte and encoded character data of a unicode string. This includes:
        • byte optionFlags
        • encoded character data (in "ISO-8859-1" or "UTF-16LE" encoding)
        Notes:
        • The value of the 'is16bitEncoded' flag is determined by the actual character data of text
        • The string options flag is never separated (by a ContinueRecord) from the first chunk of character data it refers to.
        • The 'ushort length' field is assumed to have been explicitly written earlier. Hence, there may be an intervening ContinueRecord
      • writeString

        public void writeString​(String text,
                                int numberOfRichTextRuns,
                                int extendedDataSize)
        Writes a unicode string complete with header and character data. This includes:
        • ushort length
        • byte optionFlags
        • ushort numberOfRichTextRuns (optional)
        • ushort extendedDataSize (optional)
        • encoded character data (in "ISO-8859-1" or "UTF-16LE" encoding)
        The following bits of the 'optionFlags' byte will be set as appropriate:
        bits of the 'optionFlags'
        MaskDescription
        0x01is16bitEncoded
        0x04hasExtendedData
        0x08isRichText
        Notes:
        • The value of the 'is16bitEncoded' flag is determined by the actual character data of text
        • The string header fields are never separated (by a ContinueRecord) from the first chunk of character data (i.e. the first character is always encoded in the same record as the string header).
      • write

        public void write​(byte[] b,
                          int offset,
                          int len)
        Specified by:
        write in interface LittleEndianOutput