Class POIFSDocument

java.lang.Object
org.apache.poi.poifs.filesystem.POIFSDocument
All Implemented Interfaces:
Iterable<ByteBuffer>, POIFSViewable

public final class POIFSDocument extends Object implements POIFSViewable, Iterable<ByteBuffer>
This class manages a document in the NIO POIFS filesystem. This is the POIFSFileSystem version.
  • Constructor Details

  • Method Details

    • iterator

      public Iterator<ByteBuffer> iterator()
      Specified by:
      iterator in interface Iterable<ByteBuffer>
    • getSize

      public int getSize()
      Returns:
      size of the document
    • replaceContents

      public void replaceContents(InputStream stream) throws IOException
      Throws:
      IOException
    • getViewableArray

      public Object[] getViewableArray()
      Get an array of objects, some of which may implement POIFSViewable
      Specified by:
      getViewableArray in interface POIFSViewable
      Returns:
      an array of Object; may not be null, but may be empty
    • getViewableIterator

      public Iterator<Object> getViewableIterator()
      Get an Iterator of objects, some of which may implement POIFSViewable
      Specified by:
      getViewableIterator in interface POIFSViewable
      Returns:
      an Iterator; may not be null, but may have an empty back end store
    • preferArray

      public boolean preferArray()
      Give viewers a hint as to whether to call getViewableArray or getViewableIterator
      Specified by:
      preferArray in interface POIFSViewable
      Returns:
      true if a viewer should call getViewableArray, false if a viewer should call getViewableIterator
    • getShortDescription

      public String getShortDescription()
      Provides a short description of the object, to be used when a POIFSViewable object has not provided its contents.
      Specified by:
      getShortDescription in interface POIFSViewable
      Returns:
      short description