FileDocCategorySizeDatePackage
ExObjListAtom.javaAPI DocApache Poi 3.0.13449Sun Mar 11 12:59:30 GMT 2007org.apache.poi.hslf.record

ExObjListAtom

public class ExObjListAtom extends RecordAtom
Tne atom that holds the seed info used by a ExObjList
author
Nick Burch

Fields Summary
private byte[]
_header
Record header.
private byte[]
_data
Record data.
Constructors Summary
protected ExObjListAtom()
Constructs a brand new link related atom record.

        _header = new byte[8];
        _data = new byte[4];

        LittleEndian.putShort(_header, 2, (short)getRecordType());
        LittleEndian.putInt(_header, 4, _data.length);
        
        // It is fine for the other values to be zero
    
protected ExObjListAtom(byte[] source, int start, int len)
Constructs the link related atom record from its source data.

param
source the source data as a byte array.
param
start the start offset into the byte array.
param
len the length of the slice in the byte array.

        // Get the header.
        _header = new byte[8];
        System.arraycopy(source,start,_header,0,8);
        
        // Get the record data.
        _data = new byte[len-8];
        System.arraycopy(source,start+8,_data,0,len-8);
        
        // Must be at least 4 bytes long
        if(_data.length < 4) {
        	throw new IllegalArgumentException("The length of the data for a ExObjListAtom must be at least 4 bytes, but was only " + _data.length);
        }
    
Methods Summary
public longgetObjectIDSeed()
Gets the object ID seed, which will be used as the unique OLE identifier for the next OLE object added

return
the object ID seed

        return LittleEndian.getUInt(_data,0);
    
public longgetRecordType()
Gets the record type.

return
the record type.

 return RecordTypes.ExObjListAtom.typeID; 
public voidsetObjectIDSeed(int seed)
Sets the object ID seed

param
seed the new ID seed

        LittleEndian.putInt(_data,0,seed);
    
public voidwriteOut(java.io.OutputStream out)
Write the contents of the record back, so it can be written to disk

param
out the output stream to write to.
throws
IOException if an error occurs.

        out.write(_header);
        out.write(_data);