1 2 17 18 19 package org.apache.poi.hssf.record; 20 21 import org.apache.poi.util.LittleEndian; 22 23 33 34 public class EOFRecord 35 extends Record 36 { 37 public final static short sid = 0x0A; 38 39 public EOFRecord() 40 { 41 } 42 43 50 51 public EOFRecord(short id, short size, byte [] data) 52 { 53 super(id, size, data); 54 } 55 56 64 65 public EOFRecord(short id, short size, byte [] data, int offset) 66 { 67 super(id, size, data, offset); 68 } 69 70 protected void validateSid(short id) 71 { 72 if (id != sid) 73 { 74 throw new RecordFormatException("NOT An EOF RECORD"); 75 } 76 } 77 78 protected void fillFields(byte [] data, short size, int offset) 79 { 80 } 81 82 public String toString() 83 { 84 StringBuffer buffer = new StringBuffer (); 85 86 buffer.append("[EOF]\n"); 87 buffer.append("[/EOF]\n"); 88 return buffer.toString(); 89 } 90 91 public int serialize(int offset, byte [] data) 92 { 93 LittleEndian.putShort(data, 0 + offset, sid); 94 LittleEndian.putShort(data, 2 + offset, 95 (( short ) 0)); return getRecordSize(); 97 } 98 99 public int getRecordSize() 100 { 101 return 4; 102 } 103 104 public short getSid() 105 { 106 return this.sid; 107 } 108 109 public Object clone() { 110 EOFRecord rec = new EOFRecord(); 111 return rec; 112 } 113 } 114 | Popular Tags |