public class ByteArrayBackedDataSource extends DataSource
DataSource
backed by a byte array.
(由字节数组支持的 POIFS 数据源。)
Constructor and Description |
---|
ByteArrayBackedDataSource(byte[] data) |
ByteArrayBackedDataSource(byte[] data, int size) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the underlying stream
(关闭底层流)
|
void |
copyTo(java.io.OutputStream stream)
Copies the contents to the specified OutputStream
(将内容复制到指定的 OutputStream)
|
java.nio.ByteBuffer |
read(int length, long position) |
long |
size() |
void |
write(java.nio.ByteBuffer src, long position) |
public ByteArrayBackedDataSource(byte[] data, int size)
public ByteArrayBackedDataSource(byte[] data)
public java.nio.ByteBuffer read(int length, long position)
read
in class
DataSource
(读入类 DataSource)
public void write(java.nio.ByteBuffer src, long position)
write
in class
DataSource
(写入类 DataSource)
public void copyTo(java.io.OutputStream stream) throws java.io.IOException
DataSource
copyTo
in class
DataSource
(类 DataSource 中的 copyTo)
java.io.IOException
(java.io.IOException)
public long size()
size
in class
DataSource
(类 DataSource 中的大小)
public void close()
DataSource
close
in class
DataSource
(在类 DataSource 中关闭)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.