Top Description Fields Constructors Methods
org.apache.poi.poifs.nio

public Class ByteArrayBackedDataSource

extends DataSource
Class Inheritance
Imports
org.apache.poi.util.IOUtils, java.io.IOException, .OutputStream, java.nio.ByteBuffer

A POIFS DataSource backed by a byte array.

Field Summary

Modifier and TypeField and Description
private byte[]
private static final int
private long

Constructor Summary

AccessConstructor and Description
public
ByteArrayBackedDataSource(byte[] data, int size)

public

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements abstract org.apache.poi.poifs.nio.DataSource.close.

Close the underlying stream

public void
copyTo(OutputStream stream)

Implements abstract org.apache.poi.poifs.nio.DataSource.copyTo.

Copies the contents to the specified OutputStream

private void
extend(long length)

public ByteBuffer
read(int length, long position)

Implements abstract org.apache.poi.poifs.nio.DataSource.read.

public long
public void
write(ByteBuffer src, long position)

Implements abstract org.apache.poi.poifs.nio.DataSource.write.

Field Detail

bufferback to summary
private byte[] buffer
MAX_RECORD_LENGTHback to summary
private static final int MAX_RECORD_LENGTH
sizeback to summary
private long size

Constructor Detail

ByteArrayBackedDataSourceback to summary
public ByteArrayBackedDataSource(byte[] data, int size)
ByteArrayBackedDataSourceback to summary
public ByteArrayBackedDataSource(byte[] data)

Method Detail

closeback to summary
public void close()

Implements abstract org.apache.poi.poifs.nio.DataSource.close.

Doc from org.apache.poi.poifs.nio.DataSource.close.

Close the underlying stream

Annotations
@Override
copyToback to summary
public void copyTo(OutputStream stream) throws IOException

Implements abstract org.apache.poi.poifs.nio.DataSource.copyTo.

Doc from org.apache.poi.poifs.nio.DataSource.copyTo.

Copies the contents to the specified OutputStream

Annotations
@Override
extendback to summary
private void extend(long length)
readback to summary
public ByteBuffer read(int length, long position)

Implements abstract org.apache.poi.poifs.nio.DataSource.read.

Annotations
@Override
sizeback to summary
public long size()

Implements abstract org.apache.poi.poifs.nio.DataSource.size.

Annotations
@Override
writeback to summary
public void write(ByteBuffer src, long position)

Implements abstract org.apache.poi.poifs.nio.DataSource.write.

Annotations
@Override