Class NDocumentInputStream
java.lang.Object
java.io.InputStream
org.docx4j.org.apache.poi.poifs.filesystem.DocumentInputStream
org.docx4j.org.apache.poi.poifs.filesystem.NDocumentInputStream
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,LittleEndianInput
public final class NDocumentInputStream extends DocumentInputStream
This class provides methods to read a DocumentEntry managed by a
NPOIFSFileSystem
instance.-
Field Summary
Fields inherited from class org.docx4j.org.apache.poi.poifs.filesystem.DocumentInputStream
EOF, SIZE_INT, SIZE_LONG, SIZE_SHORT
-
Constructor Summary
Constructors Constructor Description NDocumentInputStream(DocumentEntry document)
Create an InputStream from the specified DocumentEntryNDocumentInputStream(NPOIFSDocument document)
Create an InputStream from the specified Document -
Method Summary
Modifier and Type Method Description int
available()
void
close()
void
mark(int ignoredReadlimit)
int
read()
int
read(byte[] b, int off, int len)
byte
readByte()
double
readDouble()
void
readFully(byte[] buf, int off, int len)
int
readInt()
long
readLong()
short
readShort()
int
readUByte()
int
readUShort()
void
reset()
Repositions this stream to the position at the time the mark() method was last called on this input stream.long
skip(long n)
Methods inherited from class org.docx4j.org.apache.poi.poifs.filesystem.DocumentInputStream
markSupported, read, readFully, readUInt
-
Constructor Details
-
NDocumentInputStream
Create an InputStream from the specified DocumentEntry- Parameters:
document
- the DocumentEntry to be read- Throws:
java.io.IOException
- if the DocumentEntry cannot be opened (like, maybe it has been deleted?)
-
NDocumentInputStream
Create an InputStream from the specified Document- Parameters:
document
- the Document to be read
-
-
Method Details
-
available
public int available()- Specified by:
available
in interfaceLittleEndianInput
- Overrides:
available
in classDocumentInputStream
-
close
public void close()- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classDocumentInputStream
-
mark
public void mark(int ignoredReadlimit)- Overrides:
mark
in classDocumentInputStream
-
read
public int read() throws java.io.IOException- Overrides:
read
in classDocumentInputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
read
in classDocumentInputStream
- Throws:
java.io.IOException
-
reset
public 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:
reset
in classDocumentInputStream
-
skip
public long skip(long n) throws java.io.IOException- Overrides:
skip
in classDocumentInputStream
- Throws:
java.io.IOException
-
readFully
public void readFully(byte[] buf, int off, int len)- Specified by:
readFully
in interfaceLittleEndianInput
- Overrides:
readFully
in classDocumentInputStream
-
readByte
public byte readByte()- Specified by:
readByte
in interfaceLittleEndianInput
- Overrides:
readByte
in classDocumentInputStream
-
readDouble
public double readDouble()- Specified by:
readDouble
in interfaceLittleEndianInput
- Overrides:
readDouble
in classDocumentInputStream
-
readLong
public long readLong()- Specified by:
readLong
in interfaceLittleEndianInput
- Overrides:
readLong
in classDocumentInputStream
-
readShort
public short readShort()- Specified by:
readShort
in interfaceLittleEndianInput
- Overrides:
readShort
in classDocumentInputStream
-
readInt
public int readInt()- Specified by:
readInt
in interfaceLittleEndianInput
- Overrides:
readInt
in classDocumentInputStream
-
readUShort
public int readUShort()- Specified by:
readUShort
in interfaceLittleEndianInput
- Overrides:
readUShort
in classDocumentInputStream
-
readUByte
public int readUByte()- Specified by:
readUByte
in interfaceLittleEndianInput
- Overrides:
readUByte
in classDocumentInputStream
-