loci.formats.services

## Interface POIService

- All Superinterfaces:
    loci.common.services.Service
  All Known Implementing Classes:
    POIServiceImpl

      public interface POIService
      extends loci.common.services.Service

  Interface defining methods for reading Microsoft OLE2 documents using OME's fork of Apache POI.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close the current POI file system.
    `byte[]` | `getDocumentBytes(java.lang.String file)` Retrieve all of the raw bytes that correspond to the given file name.
    `byte[]` | `getDocumentBytes(java.lang.String file, int length)` Retrieve at most 'length' bytes that correspond to the given file name.
    `java.util.Vector<java.lang.String>` | `getDocumentList()` Retrieve a list of all files in the current POI file system.
    `loci.common.RandomAccessInputStream` | `getDocumentStream(java.lang.String file)` Retrieve a RandomAccessInputStream corresponding to the given file name.
    `int` | `getFileSize(java.lang.String file)` Retrieve the total number of bytes in the given file.
    `java.io.InputStream` | `getInputStream(java.lang.String file)` Retrieve an InputStream corresponding to the given file name.
    `void` | `initialize(loci.common.RandomAccessInputStream stream)` Construct a new POI filesystem around the given stream.
    `void` | `initialize(java.lang.String file)` Construct a new POI filesystem around the given file.

- - ### Method Detail

    - #### initialize

          void initialize(java.lang.String file)
                   throws java.io.IOException

      Construct a new POI filesystem around the given file.
      Throws:
        `java.io.IOException` - if an error occurred when opening the file.

    - #### initialize

          void initialize(loci.common.RandomAccessInputStream stream)
                   throws java.io.IOException

      Construct a new POI filesystem around the given stream.
      Throws:
        `java.io.IOException` - if an error occurred when reading from the stream.

    - #### getInputStream

          java.io.InputStream getInputStream(java.lang.String file)
                                      throws java.io.IOException

      Retrieve an InputStream corresponding to the given file name. Either of the 'initialize' methods must be called before this method.
      Parameters:
        `file` - The name of the embedded file for which to retrieve an InputStream.
      Throws:
        `java.io.IOException` - if an error occurred when reading the file

    - #### getDocumentStream

          loci.common.RandomAccessInputStream getDocumentStream(java.lang.String file)
                                                         throws java.io.IOException

      Retrieve a RandomAccessInputStream corresponding to the given file name. Either of the 'initialize' methods must be called before this method.
      Parameters:
        `file` - The name of the embedded file for which to retrieve a RandomAccessInputStream.
      Throws:
        `java.io.IOException` - if an error occurred when reading the file

    - #### getDocumentBytes

          byte[] getDocumentBytes(java.lang.String file)
                           throws java.io.IOException

      Retrieve all of the raw bytes that correspond to the given file name. Either of the 'initialize' methods must be called before this method.
      Parameters:
        `file` - The name of the embedded file for which to retrieve bytes.
      Throws:
        `java.io.IOException` - if an error occurred when reading the file

    - #### getDocumentBytes

          byte[] getDocumentBytes(java.lang.String file,
                                  int length)
                           throws java.io.IOException

      Retrieve at most 'length' bytes that correspond to the given file name. Either of the 'initialize' methods must be called before this method.
      Parameters:
        `file` - The name of the embedded file for which to retrieve bytes.
      Throws:
        `java.io.IOException` - if an error occurred when reading the file

    - #### getFileSize

          int getFileSize(java.lang.String file)

      Retrieve the total number of bytes in the given file. Either of the 'initialize' methods must be called before this method.
      Parameters:
        `file` - The name of the embedded file.
      Throws:
        `java.io.IOException` - if an error occurred when reading the file

    - #### getDocumentList

          java.util.Vector<java.lang.String> getDocumentList()

      Retrieve a list of all files in the current POI file system.

    - #### close

          void close()
              throws java.io.IOException

      Close the current POI file system.
      Throws:
        `java.io.IOException`

Copyright © 2026 Open Microscopy Environment