1 19 20 package jxl.write.biff; 21 22 import jxl.biff.Type; 23 import jxl.biff.IntegerHelper; 24 import jxl.biff.StringHelper; 25 import jxl.biff.WritableRecordData; 26 27 30 class HeaderRecord extends WritableRecordData 31 { 32 35 private byte[] data; 36 39 private String header; 40 41 46 public HeaderRecord(String h) 47 { 48 super(Type.HEADER); 49 50 header = h; 51 } 52 53 58 public HeaderRecord(HeaderRecord hr) 59 { 60 super(Type.HEADER); 61 62 header = hr.header; 63 } 64 65 70 public byte[] getData() 71 { 72 if (header == null || header.length() == 0) 73 { 74 data = new byte[0]; 75 return data; 76 } 77 78 data = new byte[header.length() * 2 + 3]; 79 IntegerHelper.getTwoBytes(header.length(), data, 0); 80 data[2] = (byte) 0x1; 81 82 StringHelper.getUnicodeBytes(header, data, 3); 83 84 return data; 85 } 86 } 87 88 89 | Popular Tags |