Package org.apache.poi.poifs.filesystem
Class DocumentInputStream
- java.lang.Object
- 
- java.io.InputStream
- 
- org.apache.poi.poifs.filesystem.DocumentInputStream
 
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- LittleEndianInput
 
 public final class DocumentInputStream extends InputStream implements LittleEndianInput This class provides methods to read a DocumentEntry managed by aPOIFSFileSysteminstance.
- 
- 
Constructor SummaryConstructors Constructor Description DocumentInputStream(DocumentEntry document)Create an InputStream from the specified DocumentEntryDocumentInputStream(POIFSDocument document)Create an InputStream from the specified Document
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()voidmark(int ignoredReadlimit)booleanmarkSupported()Tests if this input stream supports the mark and reset methods.intread()intread(byte[] b)intread(byte[] b, int off, int len)bytereadByte()doublereadDouble()voidreadFully(byte[] buf)voidreadFully(byte[] buf, int off, int len)intreadInt()longreadLong()voidreadPlain(byte[] buf, int off, int len)Usually acts the same asLittleEndianInput.readFully(byte[], int, int), but for an encrypted stream the raw (unencrypted) data is filledshortreadShort()intreadUByte()longreadUInt()intreadUShort()voidreset()Repositions this stream to the position at the time the mark() method was last called on this input stream.longskip(long n)- 
Methods inherited from class java.io.InputStreamnullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
 
- 
 
- 
- 
- 
Constructor Detail- 
DocumentInputStreampublic DocumentInputStream(DocumentEntry document) throws IOException Create an InputStream from the specified DocumentEntry- Parameters:
- document- the DocumentEntry to be read
- Throws:
- IOException- if the DocumentEntry cannot be opened (like, maybe it has been deleted?)
 
 - 
DocumentInputStreampublic DocumentInputStream(POIFSDocument document) Create an InputStream from the specified Document- Parameters:
- document- the Document to be read
 
 
- 
 - 
Method Detail- 
availablepublic int available() - Specified by:
- availablein interface- LittleEndianInput
- Overrides:
- availablein class- InputStream
 
 - 
closepublic void close() - Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- InputStream
 
 - 
markSupportedpublic boolean markSupported() Tests if this input stream supports the mark and reset methods.- Overrides:
- markSupportedin class- InputStream
- Returns:
- truealways
 
 - 
markpublic void mark(int ignoredReadlimit) - Overrides:
- markin class- InputStream
 
 - 
readpublic int read() throws IOException- Specified by:
- readin class- InputStream
- Throws:
- IOException
 
 - 
readpublic int read(byte[] b) throws IOException- Overrides:
- readin class- InputStream
- Throws:
- IOException
 
 - 
readpublic int read(byte[] b, int off, int len) throws IOException- Overrides:
- readin class- InputStream
- Throws:
- IOException
 
 - 
resetpublic void reset() Repositions this stream to the position at the time the mark() method was last called on this input stream. If mark() has not been called this method repositions the stream to its beginning.- Overrides:
- resetin class- InputStream
 
 - 
skippublic long skip(long n) throws IOException- Overrides:
- skipin class- InputStream
- Throws:
- IOException
 
 - 
readFullypublic void readFully(byte[] buf) - Specified by:
- readFullyin interface- LittleEndianInput
 
 - 
readFullypublic void readFully(byte[] buf, int off, int len)- Specified by:
- readFullyin interface- LittleEndianInput
 
 - 
readPlainpublic void readPlain(byte[] buf, int off, int len)Description copied from interface:LittleEndianInputUsually acts the same asLittleEndianInput.readFully(byte[], int, int), but for an encrypted stream the raw (unencrypted) data is filled- Specified by:
- readPlainin interface- LittleEndianInput
- Parameters:
- buf- the byte array to receive the bytes
- off- the start offset into the byte array
- len- the amount of bytes to fill
 
 - 
readBytepublic byte readByte() - Specified by:
- readBytein interface- LittleEndianInput
 
 - 
readDoublepublic double readDouble() - Specified by:
- readDoublein interface- LittleEndianInput
 
 - 
readLongpublic long readLong() - Specified by:
- readLongin interface- LittleEndianInput
 
 - 
readShortpublic short readShort() - Specified by:
- readShortin interface- LittleEndianInput
 
 - 
readIntpublic int readInt() - Specified by:
- readIntin interface- LittleEndianInput
 
 - 
readUIntpublic long readUInt() 
 - 
readUShortpublic int readUShort() - Specified by:
- readUShortin interface- LittleEndianInput
 
 - 
readUBytepublic int readUByte() - Specified by:
- readUBytein interface- LittleEndianInput
 
 
- 
 
-