static class SaxReaderImpl.FileInputStreamWrapper
extends java.io.InputStream
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
fileName
File name.
|
private boolean |
isStarted
Lazy initialization flag.
|
private Stream |
stream
Buffered input Stream.
|
Constructor and Description |
---|
FileInputStreamWrapper(java.lang.String source)
Constructor accepting a file name, which will read after first call.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close input stream.
|
private void |
init(boolean canWrite)
Initialization method which creates stream wrapper.
|
int |
read()
Reads the next byte of data from the input stream.
|
void |
reset()
Resets the input stream to begin reading from the first character
of this input stream's underlying buffer.
|
private final java.lang.String fileName
private volatile boolean isStarted
private Stream stream
FileInputStreamWrapper(java.lang.String source)
source
- A file name.public int read() throws java.io.IOException
int
in the range 0
to
255
. If no byte is available because the end of the stream
has been reached, the value -1
is returned.read
in class java.io.InputStream
java.io.IOException
public void reset() throws java.io.IOException
reset
in class java.io.InputStream
java.io.IOException
private void init(boolean canWrite) throws java.io.IOException
canWrite
- if true
than file will open in read/write mode, otherwise only in
read mode.java.io.IOException
- In case of I/O errors.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException