Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.poi.hssf.record.cont
Class ContinuableRecordOutput

    java.lang.Object
      org.apache.poi.hssf.record.cont.ContinuableRecordOutput

All Implemented Interfaces:
  LittleEndianOutput

    public final class ContinuableRecordOutput

extends java.lang.Object
implements LittleEndianOutput

An augmented `LittleEndianOutput` used for serialization of `ContinuableRecord`s. This class keeps track of how much remaining space is available in the current BIFF record and can start new `ContinueRecord`s as required.

Author:
  Josh Micich

Constructor Summary
`ContinuableRecordOutput(LittleEndianOutput out, int sid)`

Method Summary
`static ContinuableRecordOutput` | `createForCountingOnly()`
`int` | `getAvailableSpace()`
`int` | `getTotalSize()`
`void` | `write(byte[] b)`
`void` | `write(byte[] b, int offset, int len)`
`void` | `writeByte(int v)`
`void` | `writeContinue()` Terminates the current record and starts a new `ContinueRecord` (regardless of how much space is still available in the current record).
`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
`void` | `writeDouble(double v)`
`void` | `writeInt(int v)`
`void` | `writeLong(long v)`
`void` | `writeShort(int v)`
`void` | `writeString(java.lang.String text, int numberOfRichTextRuns, int extendedDataSize)` Writes a unicode string complete with header and character data.
`void` | `writeStringData(java.lang.String text)` Writes the 'optionFlags' byte and encoded character data of a unicode string.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ContinuableRecordOutput

    public ContinuableRecordOutput(LittleEndianOutput out,
                                   int sid)

Method Detail

### createForCountingOnly

    public static ContinuableRecordOutput createForCountingOnly()

### 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(java.lang.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(java.lang.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:

  Mask | Description
  --- | ---
  0x01 | is16bitEncoded
  0x04 | hasExtendedData
  0x08 | isRichText

  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)

  Specified by:
    `write` in interface `LittleEndianOutput`

### write

    public void write(byte[] b,
                      int offset,
                      int len)

  Specified by:
    `write` in interface `LittleEndianOutput`

### writeByte

    public void writeByte(int v)

  Specified by:
    `writeByte` in interface `LittleEndianOutput`

### writeDouble

    public void writeDouble(double v)

  Specified by:
    `writeDouble` in interface `LittleEndianOutput`

### writeInt

    public void writeInt(int v)

  Specified by:
    `writeInt` in interface `LittleEndianOutput`

### writeLong

    public void writeLong(long v)

  Specified by:
    `writeLong` in interface `LittleEndianOutput`

### writeShort

    public void writeShort(int v)

  Specified by:
    `writeShort` in interface `LittleEndianOutput`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD