Package org.apache.poi.sl.usermodel
Interface ObjectData
-
public interface ObjectDataCommon interface for OLE shapes, i.e. shapes linked to embedded documents- Since:
- POI 4.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default byte[]getBytes()Convenience method to get the embedded data as byte array.default DirectoryEntrygetDirectory()Gets the object data.StringgetFileName()InputStreamgetInputStream()Gets an input stream which returns the binary of the embedded data.StringgetOLE2ClassName()OutputStreamgetOutputStream()default booleanhasDirectoryEntry()
-
-
-
Method Detail
-
getInputStream
InputStream getInputStream() throws IOException
Gets an input stream which returns the binary of the embedded data.- Returns:
- the input stream which will contain the binary of the embedded data.
- Throws:
IOException
-
getOutputStream
OutputStream getOutputStream() throws IOException
- Returns:
- the object data as stream (for writing)
- Throws:
IOException
-
getBytes
default byte[] getBytes() throws IOExceptionConvenience method to get the embedded data as byte array.- Returns:
- the embedded data.
- Throws:
IOException
-
hasDirectoryEntry
default boolean hasDirectoryEntry()
- Returns:
- does this ObjectData have an associated POIFS Directory Entry? (Not all do, those that don't have a data portion)
-
getDirectory
default DirectoryEntry getDirectory() throws IOException
Gets the object data. Only call for ones that have data though. SeehasDirectoryEntry(). The caller has to close the corresponding POIFSFileSystem- Returns:
- the object data as an OLE2 directory.
- Throws:
IOException- if there was an error reading the data.
-
getOLE2ClassName
String getOLE2ClassName()
- Returns:
- the OLE2 Class Name of the object
-
getFileName
String getFileName()
- Returns:
- a filename suggestion - inspecting/interpreting the Directory object probably gives a better result
-
-