1 19 20 package jxl.read.biff; 21 22 import common.Logger; 23 24 import jxl.biff.IntegerHelper; 25 import jxl.biff.RecordData; 26 27 30 class DimensionRecord extends RecordData 31 { 32 35 private static Logger logger = Logger.getLogger(DimensionRecord.class); 36 37 40 private int numRows; 41 44 private int numCols; 45 46 49 private static class Biff7 {}; 50 public static Biff7 biff7 = new Biff7(); 51 52 57 public DimensionRecord(Record t) 58 { 59 super(t); 60 byte[] data = t.getData(); 61 62 if (data.length == 10) 67 { 68 read10ByteData(data); 69 } 70 else 71 { 72 read14ByteData(data); 73 } 74 } 75 76 82 public DimensionRecord(Record t, Biff7 biff7) 83 { 84 super(t); 85 byte[] data = t.getData(); 86 read10ByteData(data); 87 } 88 89 93 private void read10ByteData(byte[] data) 94 { 95 numRows = IntegerHelper.getInt(data[2], data[3]); 96 numCols = IntegerHelper.getInt(data[6], data[7]); 97 } 98 99 103 private void read14ByteData(byte[] data) 104 { 105 numRows = IntegerHelper.getInt(data[4], data[5], data[6], data[7]); 106 numCols = IntegerHelper.getInt(data[10], data[11]); 107 } 108 109 114 public int getNumberOfRows() 115 { 116 return numRows; 117 } 118 119 124 public int getNumberOfColumns() 125 { 126 return numCols; 127 } 128 } 129 130 131 132 133 134 135 136 | Popular Tags |