TextHeaderAtompublic class TextHeaderAtom extends RecordAtom implements ParentAwareRecordA TextHeaderAtom (type 3999). Holds information on what kind of
text is contained in the TextBytesAtom / TextCharsAtom that follows
straight after |
Fields Summary |
---|
private byte[] | _header | private static long | _type | private RecordContainer | parentRecord | public static final int | TITLE_TYPE | public static final int | BODY_TYPE | public static final int | NOTES_TYPE | public static final int | OTHER_TYPE | public static final int | CENTRE_BODY_TYPE | public static final int | CENTER_TITLE_TYPE | public static final int | HALF_BODY_TYPE | public static final int | QUARTER_BODY_TYPE | private int | textTypeThe kind of text it is |
Constructors Summary |
---|
protected TextHeaderAtom(byte[] source, int start, int len)For the TextHeader Atom
// Sanity Checking - we're always 12 bytes long
if(len < 12) {
len = 12;
if(source.length - start < 12) {
throw new RuntimeException("Not enough data to form a TextHeaderAtom (always 12 bytes long) - found " + (source.length - start));
}
}
// Get the header
_header = new byte[8];
System.arraycopy(source,start,_header,0,8);
// Grab the type
textType = (int)LittleEndian.getInt(source,start+8);
| public TextHeaderAtom()Create a new TextHeader Atom, for an unknown type of text
_header = new byte[8];
LittleEndian.putUShort(_header, 0, 0);
LittleEndian.putUShort(_header, 2, (int)_type);
LittleEndian.putInt(_header, 4, 4);
textType = OTHER_TYPE;
|
Methods Summary |
---|
public org.apache.poi.hslf.record.RecordContainer | getParentRecord() return parentRecord;
| public long | getRecordType()We are of type 3999 return _type;
| public int | getTextType()
return textType;
| public void | setParentRecord(org.apache.poi.hslf.record.RecordContainer record) this.parentRecord = record;
| public void | setTextType(int type) textType = type;
| public void | writeOut(java.io.OutputStream out)Write the contents of the record back, so it can be written
to disk
// Header - size or type unchanged
out.write(_header);
// Write out our type
writeLittleEndian(textType,out);
|
|