1 2 17 18 19 package org.apache.poi.hssf.record; 20 21 import org.apache.poi.util.LittleEndian; 22 import org.apache.poi.util.LittleEndianConsts; 23 24 29 class SSTRecordHeader 30 { 31 int numStrings; 32 int numUniqueStrings; 33 34 public SSTRecordHeader( int numStrings, int numUniqueStrings ) 35 { 36 this.numStrings = numStrings; 37 this.numUniqueStrings = numUniqueStrings; 38 } 39 40 50 public int writeSSTHeader( byte[] data, int bufferIndex, int recSize ) 51 { 52 int offset = bufferIndex; 53 54 LittleEndian.putShort( data, offset, SSTRecord.sid ); 55 offset += LittleEndianConsts.SHORT_SIZE; 56 LittleEndian.putShort( data, offset, (short) ( recSize ) ); 57 offset += LittleEndianConsts.SHORT_SIZE; 58 LittleEndian.putInt( data, offset, numStrings ); 60 offset += LittleEndianConsts.INT_SIZE; 61 LittleEndian.putInt( data, offset, numUniqueStrings ); 63 offset += LittleEndianConsts.INT_SIZE; 64 return offset - bufferIndex; 65 } 66 67 } 68 | Popular Tags |