1 2 17 18 19 24 package org.apache.poi.hssf.record; 25 26 import org.apache.poi.util.LittleEndian; 27 28 35 36 public class ExtSSTInfoSubRecord 37 extends Record 38 { 39 public static final int INFO_SIZE = 8; 40 public final static short sid = 41 0xFFF; private int field_1_stream_pos; private short field_2_bucket_sst_offset; private short field_3_zero; 46 47 48 public ExtSSTInfoSubRecord() 49 { 50 } 51 52 public ExtSSTInfoSubRecord(short id, short size, byte [] data) 53 { 54 super(id, size, data); 55 } 56 57 public ExtSSTInfoSubRecord(short id, short size, byte [] data, int offset) 58 { 59 super(id, size, data, offset); 60 } 61 62 protected void validateSid(short id) 63 { 64 65 } 67 68 protected void fillFields(byte [] data, short size, int offset) 69 { 70 field_1_stream_pos = LittleEndian.getInt(data, 0 + offset); 71 field_2_bucket_sst_offset = LittleEndian.getShort(data, 4 + offset); 72 field_3_zero = LittleEndian.getShort(data, 6 + offset); 73 } 74 75 public void setStreamPos(int pos) 76 { 77 field_1_stream_pos = pos; 78 } 79 80 public void setBucketRecordOffset(short offset) 81 { 82 field_2_bucket_sst_offset = offset; 83 } 84 85 public int getStreamPos() 86 { 87 return field_1_stream_pos; 88 } 89 90 public short getBucketSSTOffset() 91 { 92 return field_2_bucket_sst_offset; 93 } 94 95 public String toString() 96 { 97 StringBuffer buffer = new StringBuffer (); 98 99 buffer.append("[EXTSST]\n"); 100 buffer.append(" .streampos = ") 101 .append(Integer.toHexString(getStreamPos())).append("\n"); 102 buffer.append(" .bucketsstoffset= ") 103 .append(Integer.toHexString(getBucketSSTOffset())).append("\n"); 104 buffer.append(" .zero = ") 105 .append(Integer.toHexString(field_3_zero)).append("\n"); 106 buffer.append("[/EXTSST]\n"); 107 return buffer.toString(); 108 } 109 110 public int serialize(int offset, byte [] data) 111 { 112 LittleEndian.putInt(data, 0 + offset, getStreamPos()); 113 LittleEndian.putShort(data, 4 + offset, getBucketSSTOffset()); 114 LittleEndian.putShort(data, 6 + offset, ( short ) 0); 115 return getRecordSize(); 116 } 117 118 public int getRecordSize() 119 { 120 return 8; 121 } 122 123 public short getSid() 124 { 125 return sid; 126 } 127 } 128 | Popular Tags |