org.apache.poi.hssf.usermodel
Class HSSFObjectData

java.lang.Object
  extended by org.apache.poi.hssf.usermodel.HSSFObjectData

public final class HSSFObjectData
extends java.lang.Object

Represents binary object (i.e. OLE) data stored in the file. Eg. A GIF, JPEG etc...

Author:
Daniel Noll

Constructor Summary
HSSFObjectData(ObjRecord record, DirectoryEntry root)
          Constructs object data by wrapping a lower level object record.
 
Method Summary
protected  EmbeddedObjectRefSubRecord findObjectRecord()
          Finds the EmbeddedObjectRefSubRecord, or throws an Exception if there wasn't one
 DirectoryEntry getDirectory()
          Gets the object data.
 byte[] getObjectData()
          Returns the data portion, for an ObjectData that doesn't have an associated POIFS Directory Entry
 java.lang.String getOLE2ClassName()
          Returns the OLE2 Class Name of the object
 boolean hasDirectoryEntry()
          Does this ObjectData have an associated POIFS Directory Entry? (Not all do, those that don't have a data portion)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HSSFObjectData

public HSSFObjectData(ObjRecord record,
                      DirectoryEntry root)
Constructs object data by wrapping a lower level object record.

Parameters:
record - the low-level object record.
root - the root of the filesystem, required for retrieving the object data.
Method Detail

getOLE2ClassName

public java.lang.String getOLE2ClassName()
Returns the OLE2 Class Name of the object


getDirectory

public DirectoryEntry getDirectory()
                            throws java.io.IOException
Gets the object data. Only call for ones that have data though. See hasDirectoryEntry()

Returns:
the object data as an OLE2 directory.
Throws:
java.io.IOException - if there was an error reading the data.

getObjectData

public byte[] getObjectData()
Returns the data portion, for an ObjectData that doesn't have an associated POIFS Directory Entry


hasDirectoryEntry

public boolean hasDirectoryEntry()
Does this ObjectData have an associated POIFS Directory Entry? (Not all do, those that don't have a data portion)


findObjectRecord

protected EmbeddedObjectRefSubRecord findObjectRecord()
Finds the EmbeddedObjectRefSubRecord, or throws an Exception if there wasn't one



Copyright 2012 The Apache Software Foundation or its licensors, as applicable.