Package org.apache.poi.poifs.nio
Class ByteArrayBackedDataSource
java.lang.Object
org.apache.poi.poifs.nio.DataSource
org.apache.poi.poifs.nio.ByteArrayBackedDataSource
A POIFS
DataSource backed by a byte array.-
Constructor Summary
ConstructorsConstructorDescriptionByteArrayBackedDataSource(byte[] data) ByteArrayBackedDataSource(byte[] data, int size) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the underlying streamvoidcopyTo(OutputStream stream) Copies the contents to the specified OutputStreamread(int length, long position) longsize()voidwrite(ByteBuffer src, long position)
-
Constructor Details
-
ByteArrayBackedDataSource
public ByteArrayBackedDataSource(byte[] data, int size) -
ByteArrayBackedDataSource
public ByteArrayBackedDataSource(byte[] data)
-
-
Method Details
-
read
- Specified by:
readin classDataSource
-
write
- Specified by:
writein classDataSource
-
copyTo
Description copied from class:DataSourceCopies the contents to the specified OutputStream- Specified by:
copyToin classDataSource- Throws:
IOException
-
size
public long size()- Specified by:
sizein classDataSource
-
close
public void close()Description copied from class:DataSourceClose the underlying stream- Specified by:
closein classDataSource
-