Package org.apache.poi.poifs.nio
Class DataSource
- java.lang.Object
-
- org.apache.poi.poifs.nio.DataSource
-
- Direct Known Subclasses:
ByteArrayBackedDataSource
,FileBackedDataSource
public abstract class DataSource extends Object
Common definition of how we read and write bytes
-
-
Constructor Summary
Constructors Constructor Description DataSource()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
close()
Close the underlying streamabstract void
copyTo(OutputStream stream)
Copies the contents to the specified OutputStreamabstract ByteBuffer
read(int length, long position)
abstract long
size()
abstract void
write(ByteBuffer src, long position)
-
-
-
Method Detail
-
read
public abstract ByteBuffer read(int length, long position) throws IOException
- Throws:
IOException
-
write
public abstract void write(ByteBuffer src, long position) throws IOException
- Throws:
IOException
-
size
public abstract long size() throws IOException
- Throws:
IOException
-
close
public abstract void close() throws IOException
Close the underlying stream- Throws:
IOException
-
copyTo
public abstract void copyTo(OutputStream stream) throws IOException
Copies the contents to the specified OutputStream- Throws:
IOException
-
-