FileDocCategorySizeDatePackage
TextHeaderAtom.javaAPI DocApache Poi 3.0.13357Mon Jan 01 18:55:34 GMT 2007org.apache.poi.hslf.record

TextHeaderAtom

public class TextHeaderAtom extends RecordAtom implements ParentAwareRecord
A TextHeaderAtom (type 3999). Holds information on what kind of text is contained in the TextBytesAtom / TextCharsAtom that follows straight after
author
Nick Burch

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
textType
The 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.RecordContainergetParentRecord()

 return parentRecord; 
public longgetRecordType()
We are of type 3999

 return _type; 
public intgetTextType()


	    return textType; 
public voidsetParentRecord(org.apache.poi.hslf.record.RecordContainer record)

 this.parentRecord = record; 
public voidsetTextType(int type)

 textType = type; 
public voidwriteOut(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);