public final class SSTRecord extends ContinuableRecord
REFERENCE: PG 389 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
LabelSSTRecord
,
ContinueRecord
Modifier and Type | Field and Description |
---|---|
static short |
sid |
Constructor and Description |
---|
SSTRecord() |
SSTRecord(RecordInputStream in)
Fill the fields from the data
|
Modifier and Type | Method and Description |
---|---|
int |
addString(UnicodeString string)
Add a string.
|
int |
calcExtSSTRecordSize()
Calculates the size in bytes of the EXTSST record as it would be if the
record was serialized.
|
ExtSSTRecord |
createExtSSTRecord(int sstOffset)
Creates an extended string record based on the current contents of
the current SST record.
|
int |
getNumStrings() |
int |
getNumUniqueStrings() |
short |
getSid()
return the non static version of the id for this record.
|
UnicodeString |
getString(int id)
Get a particular string by its index
|
protected void |
serialize(ContinuableRecordOutput out)
Serializes this record's content to the supplied data output.
The standard BIFF header (ushort sid, ushort size) has been handled by the superclass, so only BIFF data should be written by this method. |
String |
toString()
Return a debugging string representation
|
getRecordSize, serialize
clone, cloneViaReserialise, serialize
public static final short sid
public SSTRecord()
public SSTRecord(RecordInputStream in)
The data consists of sets of string data. This string data is arranged as follows:
short string_length; // length of string data
byte string_flag; // flag specifying special string
// handling
short run_count; // optional count of formatting runs
int extend_length; // optional extension length
char[] string_data; // string data, can be byte[] or
// short[] (length of array is
// string_length)
int[] formatting_runs; // optional formatting runs (length of
// array is run_count)
byte[] extension; // optional extension (length of array
// is extend_length)
The string_flag is bit mapped as follows:
Bit number | Meaning if 0 | Meaning if 1 |
---|---|---|
0 | string_data is byte[] | string_data is short[] |
1 | Should always be 0 | string_flag is defective |
2 | extension is not included | extension is included |
3 | formatting run data is not included | formatting run data is included |
4 | Should always be 0 | string_flag is defective |
5 | Should always be 0 | string_flag is defective |
6 | Should always be 0 | string_flag is defective |
7 | Should always be 0 | string_flag is defective |
We can handle eating the overhead associated with bits 2 or 3 (or both) being set, but we have no idea what to do with the associated data. The UnicodeString class can handle the byte[] vs short[] nature of the actual string data
in
- the RecordInputstream to read the record frompublic int addString(UnicodeString string)
string
- string to be addedpublic int getNumStrings()
public int getNumUniqueStrings()
public UnicodeString getString(int id)
id
- index into the array of stringspublic String toString()
public short getSid()
Record
protected void serialize(ContinuableRecordOutput out)
ContinuableRecord
LittleEndianOutput
methods. Methods from ContinuableRecordOutput
can be used to serialize strings (with ContinueRecord
s being written as required).
If necessary, implementors can explicitly start ContinueRecord
s (regardless of the
amount of remaining space).serialize
in class ContinuableRecord
out
- a data output streampublic ExtSSTRecord createExtSSTRecord(int sstOffset)
NOTE: THIS FUNCTION MUST ONLY BE CALLED AFTER THE SST RECORD HAS BEEN SERIALIZED.
sstOffset
- The offset in the stream to the start of the
SST record.public int calcExtSSTRecordSize()
Copyright © 2020. All rights reserved.