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