1 19 20 package jxl.write.biff; 21 22 import jxl.biff.Type; 23 import jxl.biff.IntegerHelper; 24 import jxl.biff.WritableRecordData; 25 26 29 class IndexRecord extends WritableRecordData 30 { 31 34 private byte[] data; 35 38 private int rows; 39 42 private int bofPosition; 43 46 private int blocks; 47 48 51 private int dataPos; 52 53 60 public IndexRecord(int pos, int r, int bl) 61 { 62 super(Type.INDEX); 63 bofPosition = pos; 64 rows = r; 65 blocks = bl; 66 67 data = new byte[16 + 4 * blocks]; 69 dataPos = 16; 70 } 71 72 79 protected byte[] getData() 80 { 81 IntegerHelper.getFourBytes(rows, data, 8); 82 return data; 83 } 84 85 90 void addBlockPosition(int pos) 91 { 92 IntegerHelper.getFourBytes(pos - bofPosition, data, dataPos); 93 dataPos += 4; 94 } 95 96 100 void setDataStartPosition(int pos) 101 { 102 IntegerHelper.getFourBytes(pos - bofPosition, data, 12); 103 } 104 } 105 | Popular Tags |