Package org.apache.poi.poifs.nio
Class FileBackedDataSource
java.lang.Object
org.apache.poi.poifs.nio.DataSource
org.apache.poi.poifs.nio.FileBackedDataSource
A POIFS
DataSource
backed by a File-
Constructor Summary
ConstructorsConstructorDescriptionFileBackedDataSource
(File file) FileBackedDataSource
(File file, boolean readOnly) FileBackedDataSource
(RandomAccessFile srcFile, boolean readOnly) FileBackedDataSource
(FileChannel channel, boolean readOnly) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the underlying streamvoid
copyTo
(OutputStream stream) Copies the contents to the specified OutputStreamboolean
read
(int length, long position) long
size()
void
write
(ByteBuffer src, long position)
-
Constructor Details
-
FileBackedDataSource
- Throws:
FileNotFoundException
-
FileBackedDataSource
- Throws:
FileNotFoundException
-
FileBackedDataSource
-
FileBackedDataSource
-
-
Method Details
-
isWriteable
public boolean isWriteable() -
getChannel
-
read
- Specified by:
read
in classDataSource
- Throws:
IOException
-
write
- Specified by:
write
in classDataSource
- Throws:
IOException
-
copyTo
Description copied from class:DataSource
Copies the contents to the specified OutputStream- Specified by:
copyTo
in classDataSource
- Throws:
IOException
-
size
- Specified by:
size
in classDataSource
- Throws:
IOException
-
close
Description copied from class:DataSource
Close the underlying stream- Specified by:
close
in classDataSource
- Throws:
IOException
-