Package loci.formats.services
Class POIServiceImpl
java.lang.Object
loci.common.services.AbstractService
loci.formats.services.POIServiceImpl
- All Implemented Interfaces:
loci.common.services.Service,POIService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate loci.poi.poifs.filesystem.POIFSFileSystemprivate static final intstatic final intprivate loci.poi.poifs.filesystem.DirectoryEntryprivate loci.common.RandomAccessInputStream -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the current POI file system.byte[]getDocumentBytes(String file) Retrieve all of the raw bytes that correspond to the given file name.byte[]getDocumentBytes(String file, int length) Retrieve at most 'length' bytes that correspond to the given file name.Retrieve a list of all files in the current POI file system.loci.common.RandomAccessInputStreamgetDocumentStream(String file) Retrieve a RandomAccessInputStream corresponding to the given file name.intgetFileSize(String file) Retrieve the total number of bytes in the given file.getInputStream(String file) Retrieve an InputStream corresponding to the given file name.voidinitialize(String file) Construct a new POI filesystem around the given file.voidinitialize(loci.common.RandomAccessInputStream s) Construct a new POI filesystem around the given stream.private voidparseFile(loci.poi.poifs.filesystem.DirectoryEntry r) Methods inherited from class loci.common.services.AbstractService
checkClassDependency
-
Field Details
-
MAX_BLOCK_SIZE
private static final int MAX_BLOCK_SIZE- See Also:
-
POI_MAGIC_BYTES
public static final int POI_MAGIC_BYTES- See Also:
-
fileSystem
private loci.poi.poifs.filesystem.POIFSFileSystem fileSystem -
root
private loci.poi.poifs.filesystem.DirectoryEntry root -
stream
private loci.common.RandomAccessInputStream stream -
filePath
-
fileSizes
-
files
-
-
Constructor Details
-
POIServiceImpl
public POIServiceImpl()Default constructor.
-
-
Method Details
-
initialize
Description copied from interface:POIServiceConstruct a new POI filesystem around the given file.- Specified by:
initializein interfacePOIService- Throws:
IOException- if an error occurred when opening the file.
-
initialize
Description copied from interface:POIServiceConstruct a new POI filesystem around the given stream.- Specified by:
initializein interfacePOIService- Throws:
IOException- if an error occurred when reading from the stream.
-
getInputStream
Description copied from interface:POIServiceRetrieve an InputStream corresponding to the given file name. Either of the 'initialize' methods must be called before this method.- Specified by:
getInputStreamin interfacePOIService- Parameters:
file- The name of the embedded file for which to retrieve an InputStream.- Throws:
IOException- if an error occurred when reading the file
-
getDocumentStream
Description copied from interface:POIServiceRetrieve a RandomAccessInputStream corresponding to the given file name. Either of the 'initialize' methods must be called before this method.- Specified by:
getDocumentStreamin interfacePOIService- Parameters:
file- The name of the embedded file for which to retrieve a RandomAccessInputStream.- Throws:
IOException- if an error occurred when reading the file
-
getDocumentBytes
Description copied from interface:POIServiceRetrieve all of the raw bytes that correspond to the given file name. Either of the 'initialize' methods must be called before this method.- Specified by:
getDocumentBytesin interfacePOIService- Parameters:
file- The name of the embedded file for which to retrieve bytes.- Throws:
IOException- if an error occurred when reading the file
-
getDocumentBytes
Description copied from interface:POIServiceRetrieve at most 'length' bytes that correspond to the given file name. Either of the 'initialize' methods must be called before this method.- Specified by:
getDocumentBytesin interfacePOIService- Parameters:
file- The name of the embedded file for which to retrieve bytes.- Throws:
IOException- if an error occurred when reading the file
-
getFileSize
Description copied from interface:POIServiceRetrieve the total number of bytes in the given file. Either of the 'initialize' methods must be called before this method.- Specified by:
getFileSizein interfacePOIService- Parameters:
file- The name of the embedded file.
-
getDocumentList
Description copied from interface:POIServiceRetrieve a list of all files in the current POI file system.- Specified by:
getDocumentListin interfacePOIService
-
close
Description copied from interface:POIServiceClose the current POI file system.- Specified by:
closein interfacePOIService- Throws:
IOException
-
parseFile
- Throws:
IOException
-