SSTRecordHeaderpublic class SSTRecordHeader extends Object Write out an SST header record. |
Fields Summary |
---|
int | numStrings | int | numUniqueStrings |
Constructors Summary |
---|
public SSTRecordHeader(int numStrings, int numUniqueStrings)
this.numStrings = numStrings;
this.numUniqueStrings = numUniqueStrings;
|
Methods Summary |
---|
public int | writeSSTHeader(UnicodeString.UnicodeRecordStats stats, byte[] data, int bufferIndex, int recSize)Writes out the SST record. This consists of the sid, the record size, the number of
strings and the number of unique strings.
int offset = bufferIndex;
LittleEndian.putShort( data, offset, SSTRecord.sid );
offset += LittleEndianConsts.SHORT_SIZE;
stats.recordSize += LittleEndianConsts.SHORT_SIZE;
stats.remainingSize -= LittleEndianConsts.SHORT_SIZE;
//Delay writing the length
stats.lastLengthPos = offset;
offset += LittleEndianConsts.SHORT_SIZE;
stats.recordSize += LittleEndianConsts.SHORT_SIZE;
stats.remainingSize -= LittleEndianConsts.SHORT_SIZE;
LittleEndian.putInt( data, offset, numStrings );
offset += LittleEndianConsts.INT_SIZE;
stats.recordSize += LittleEndianConsts.INT_SIZE;
stats.remainingSize -= LittleEndianConsts.INT_SIZE;
LittleEndian.putInt( data, offset, numUniqueStrings );
offset += LittleEndianConsts.INT_SIZE;
stats.recordSize += LittleEndianConsts.INT_SIZE;
stats.remainingSize -= LittleEndianConsts.INT_SIZE;
return offset - bufferIndex;
|
|