Package org.apache.poi.poifs.nio
Class ByteArrayBackedDataSource
- java.lang.Object
-
- org.apache.poi.poifs.nio.DataSource
-
- org.apache.poi.poifs.nio.ByteArrayBackedDataSource
-
public class ByteArrayBackedDataSource extends DataSource
A POIFSDataSource
backed by a byte array.
-
-
Constructor Summary
Constructors Constructor Description ByteArrayBackedDataSource(byte[] data)
ByteArrayBackedDataSource(byte[] data, int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the underlying streamvoid
copyTo(OutputStream stream)
Copies the contents to the specified OutputStreamByteBuffer
read(int length, long position)
long
size()
void
write(ByteBuffer src, long position)
-
-
-
Method Detail
-
read
public ByteBuffer read(int length, long position)
- Specified by:
read
in classDataSource
-
write
public void write(ByteBuffer src, long position)
- Specified by:
write
in classDataSource
-
copyTo
public void copyTo(OutputStream stream) throws IOException
Description copied from class:DataSource
Copies the contents to the specified OutputStream- Specified by:
copyTo
in classDataSource
- Throws:
IOException
-
size
public long size()
- Specified by:
size
in classDataSource
-
close
public void close()
Description copied from class:DataSource
Close the underlying stream- Specified by:
close
in classDataSource
-
-