FileDocCategorySizeDatePackage
NoteStructureSubRecord.javaAPI DocApache Poi 3.0.13672Mon Jan 01 18:59:10 GMT 2007org.apache.poi.hssf.record

NoteStructureSubRecord

public class NoteStructureSubRecord extends SubRecord
Represents a NoteStructure (0xD) sub record.

The docs say nothing about it. The length of this record is always 26 bytes.

author
Yegor Kozlov

Fields Summary
public static final short
sid
private byte[]
reserved
Constructors Summary
public NoteStructureSubRecord()
Construct a new NoteStructureSubRecord and fill its data with the default values


                     
     
    
        //all we know is that the the length of <code>NoteStructureSubRecord</code> is always 22 bytes
        reserved = new byte[22];
    
public NoteStructureSubRecord(RecordInputStream in)
Constructs a NoteStructureSubRecord and sets its fields appropriately.

        super(in);
    
    
Methods Summary
protected voidfillFields(org.apache.poi.hssf.record.RecordInputStream in)
Read the record data from the supplied RecordInputStream

        //just grab the raw data
        reserved = in.readRemainder();
    
public intgetRecordSize()
Size of record

        return 4 + reserved.length;
    
public shortgetSid()

return
id of this record.

        return sid;
    
public intserialize(int offset, byte[] data)
Serialize the record data into the supplied array of bytes

param
offset offset in the data
param
data the data to serialize into
return
size of the record

        LittleEndian.putShort(data, 0 + offset, sid);
        LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
        System.arraycopy(reserved, 0, data, offset + 4, getRecordSize() - 4);

        return getRecordSize();
    
public java.lang.StringtoString()
Convert this record to string. Used by BiffViewer and other utulities.

        StringBuffer buffer = new StringBuffer();

        String nl = System.getProperty("line.separator");
        buffer.append("[ftNts ]" + nl);
        buffer.append("  size     = ").append(getRecordSize()).append(nl);
        buffer.append("  reserved = ").append(HexDump.toHex(reserved)).append(nl);
        buffer.append("[/ftNts ]" + nl);
        return buffer.toString();
    
protected voidvalidateSid(short id)
Checks the sid matches the expected side for this record

param
id the expected sid.

        if (id != sid)
        {
            throw new RecordFormatException("Not a Note Structure record");
        }