Package loci.poi.poifs.storage
Class RawDataBlock
- java.lang.Object
-
- loci.poi.poifs.storage.RawDataBlock
-
- All Implemented Interfaces:
ListManagedBlock
public class RawDataBlock extends java.lang.Object implements ListManagedBlock
A big block created from an InputStream, holding the raw data- Author:
- Marc Johnson (mjohnson at apache dot org
-
-
Constructor Summary
Constructors Constructor Description RawDataBlock(loci.common.RandomAccessInputStream stream, int size, long pointer)Constructor RawDataBlock
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleaneof()When we read the data, did we hit end of file?intgetBlockSize()byte[]getData()Get the data from the blockintgetLength()longgetOffset()
-
-
-
Constructor Detail
-
RawDataBlock
public RawDataBlock(loci.common.RandomAccessInputStream stream, int size, long pointer) throws java.io.IOException
Constructor RawDataBlock- Parameters:
stream- the InputStream from which the data will be readsize- the block size- Throws:
java.io.IOException- on I/O errors, and if an insufficient amount of data is read
-
-
Method Detail
-
eof
public boolean eof() throws java.io.IOExceptionWhen we read the data, did we hit end of file?- Returns:
- true if no data was read because we were at the end of the file, else false
- Throws:
java.io.IOException
-
getBlockSize
public int getBlockSize()
-
getOffset
public long getOffset()
-
getLength
public int getLength()
-
getData
public byte[] getData() throws java.io.IOExceptionGet the data from the block- Specified by:
getDatain interfaceListManagedBlock- Returns:
- the block's data as a byte array
- Throws:
java.io.IOException- if there is no data
-
-