org.apache.poi.hslf.record
Class ExOleObjStg

java.lang.Object
  extended by org.apache.poi.hslf.record.Record
      extended by org.apache.poi.hslf.record.RecordAtom
          extended by org.apache.poi.hslf.record.ExOleObjStg
All Implemented Interfaces:
PersistRecord, PositionDependentRecord

public class ExOleObjStg
extends RecordAtom
implements PositionDependentRecord, PersistRecord

Storage for embedded OLE objects.

Author:
Daniel Noll

Constructor Summary
ExOleObjStg()
          Constructs a new empty storage container.
 
Method Summary
 java.io.InputStream getData()
          Opens an input stream which will decompress the data on the fly.
 int getDataLength()
          Gets the uncompressed length of the data.
 int getLastOnDiskOffset()
          Fetch our location on the disk, as of the last write out
 int getPersistId()
          Fetch our sheet ID, as found from a PersistPtrHolder.
 byte[] getRawData()
           
 long getRecordType()
          Gets the record type.
 void setData(byte[] data)
          Sets the embedded data.
 void setLastOnDiskOffset(int offset)
          Update the Record's idea of where on disk it lives, after a write out.
 void setPersistId(int id)
          Set our sheet ID, as found from a PersistPtrHolder
 void updateOtherRecordReferences(java.util.Hashtable oldToNewReferencesLookup)
          Offer the record the list of records that have changed their location as part of the writeout.
 void writeOut(java.io.OutputStream out)
          Write the contents of the record back, so it can be written to disk.
 
Methods inherited from class org.apache.poi.hslf.record.RecordAtom
getChildRecords, isAnAtom
 
Methods inherited from class org.apache.poi.hslf.record.Record
buildRecordAtOffset, createRecordForType, findChildRecords, writeLittleEndian, writeLittleEndian
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExOleObjStg

public ExOleObjStg()
Constructs a new empty storage container.

Method Detail

getDataLength

public int getDataLength()
Gets the uncompressed length of the data.

Returns:
the uncompressed length of the data.

getData

public java.io.InputStream getData()
Opens an input stream which will decompress the data on the fly.

Returns:
the data input stream.

getRawData

public byte[] getRawData()

setData

public void setData(byte[] data)
             throws java.io.IOException
Sets the embedded data.

Parameters:
data - the embedded data.
Throws:
java.io.IOException

getRecordType

public long getRecordType()
Gets the record type.

Specified by:
getRecordType in class Record
Returns:
the record type.

writeOut

public void writeOut(java.io.OutputStream out)
              throws java.io.IOException
Write the contents of the record back, so it can be written to disk.

Specified by:
writeOut in class Record
Parameters:
out - the output stream to write to.
Throws:
java.io.IOException - if an error occurs.

getPersistId

public int getPersistId()
Fetch our sheet ID, as found from a PersistPtrHolder. Should match the RefId of our matching SlidePersistAtom

Specified by:
getPersistId in interface PersistRecord

setPersistId

public void setPersistId(int id)
Set our sheet ID, as found from a PersistPtrHolder

Specified by:
setPersistId in interface PersistRecord

getLastOnDiskOffset

public int getLastOnDiskOffset()
Fetch our location on the disk, as of the last write out

Specified by:
getLastOnDiskOffset in interface PositionDependentRecord

setLastOnDiskOffset

public void setLastOnDiskOffset(int offset)
Update the Record's idea of where on disk it lives, after a write out. Use with care...

Specified by:
setLastOnDiskOffset in interface PositionDependentRecord

updateOtherRecordReferences

public void updateOtherRecordReferences(java.util.Hashtable oldToNewReferencesLookup)
Description copied from interface: PositionDependentRecord
Offer the record the list of records that have changed their location as part of the writeout.

Specified by:
updateOtherRecordReferences in interface PositionDependentRecord