org.apache.poi.sl.usermodel

## Interface ObjectData

- All Known Implementing Classes:
    HSLFObjectData, XSLFObjectData

      public interface ObjectData

  Common 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 and Description
    --- | ---
    `default byte[]` | `getBytes()` Convenience method to get the embedded data as byte array.
    `default DirectoryEntry` | `getDirectory()` Gets the object data.
    `java.lang.String` | `getFileName()`
    `java.io.InputStream` | `getInputStream()` Gets an input stream which returns the binary of the embedded data.
    `java.lang.String` | `getOLE2ClassName()`
    `java.io.OutputStream` | `getOutputStream()`
    `default boolean` | `hasDirectoryEntry()`

- - ### Method Detail

    - #### getInputStream

          java.io.InputStream getInputStream()
                                      throws java.io.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:
        `java.io.IOException`

    - #### getOutputStream

          java.io.OutputStream getOutputStream()
                                        throws java.io.IOException

      Returns:
        the object data as stream (for writing)
      Throws:
        `java.io.IOException`

    - #### getBytes

          default byte[] getBytes()
                           throws java.io.IOException

      Convenience method to get the embedded data as byte array.
      Returns:
        the embedded data.
      Throws:
        `java.io.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 java.io.IOException

      Gets the object data. Only call for ones that have data though. See `hasDirectoryEntry()`. The caller has to close the corresponding POIFSFileSystem
      Returns:
        the object data as an OLE2 directory.
      Throws:
        `java.io.IOException` - if there was an error reading the data.

    - #### getOLE2ClassName

          java.lang.String getOLE2ClassName()

      Returns:
        the OLE2 Class Name of the object

    - #### getFileName

          java.lang.String getFileName()

      Returns:
        a filename suggestion - inspecting/interpreting the Directory object probably gives a better result

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