org.apache.poi.poifs.storage
Class RawDataBlock
- java.lang.Object
-
- org.apache.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
-
-
Constructor Summary
Constructors Constructor and Description RawDataBlock(java.io.InputStream stream)Constructor RawDataBlockRawDataBlock(java.io.InputStream stream, int blockSize)Constructor RawDataBlock
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleaneof()When we read the data, did we hit end of file?intgetBigBlockSize()What's the big block size?byte[]getData()Get the data from the blockbooleanhasData()Did we actually find any data to read? It's possible, in the event of a short last block, to both have hit the EoF, but also to have datajava.lang.StringtoString()
-
-
-
Constructor Detail
-
RawDataBlock
public RawDataBlock(java.io.InputStream stream) throws java.io.IOExceptionConstructor RawDataBlock- Parameters:
stream- the InputStream from which the data will be read- Throws:
java.io.IOException- on I/O errors, and if an insufficient amount of data is read (the InputStream must be an exact multiple of the block size)
-
RawDataBlock
public RawDataBlock(java.io.InputStream stream, int blockSize) throws java.io.IOExceptionConstructor RawDataBlock- Parameters:
stream- the InputStream from which the data will be readblockSize- the size of the POIFS blocks, normally 512 bytesPOIFSConstants.SMALLER_BIG_BLOCK_SIZE- Throws:
java.io.IOException- on I/O errors, and if an insufficient amount of data is read (the InputStream must be an exact multiple of the block size)
-
-
Method Detail
-
eof
public boolean eof()
When we read the data, did we hit end of file?- Returns:
- true if the EoF was hit during this block, or false if not. If you have a dodgy short last block, then it's possible to both have data, and also hit EoF...
-
hasData
public boolean hasData()
Did we actually find any data to read? It's possible, in the event of a short last block, to both have hit the EoF, but also to have data
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
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
-
getBigBlockSize
public int getBigBlockSize()
What's the big block size?
-
-
DataMelt 3.0 © DataMelt by jWork.ORG