| java.lang.Object java.io.InputStream java.io.FilterInputStream org.w3c.util.MSFileInputStream
MSFileInputStream | public class MSFileInputStream extends FilterInputStream (Code) | | version: $Revision: 1.2 $ author: Benoît Mahé (bmahe@w3.org) |
Constructor Summary | |
public | MSFileInputStream(File file) Creates an input file stream to read from the specified file descriptor. | public | MSFileInputStream(String name) Creates an input file stream to read from a file with the
specified name. |
Method Summary | |
public synchronized void | mark(int readlimit) Marks the current position in this input stream. | public boolean | markSupported() Tests if this input stream supports the mark
and reset methods. | public int | read() Reads the next byte of data from this input stream. | public int | read(byte b) Reads up to byte.length bytes of data from this
input stream into an array of bytes. | public int | read(byte b, int off, int len) Reads up to len bytes of data from this input stream
into an array of bytes. | public synchronized void | reset() Repositions this stream to the position at the time the
mark method was last called on this input stream. |
count | protected int count(Code) | | |
markpos | protected int markpos(Code) | | |
readlimit | protected int readlimit(Code) | | |
mark | public synchronized void mark(int readlimit)(Code) | | Marks the current position in this input stream. A subsequent
call to the reset method repositions this stream at
the last marked position so that subsequent reads re-read the same
bytes.
The readlimit arguments tells this input stream to
allow that many bytes to be read before the mark position gets
invalidated.
Parameters: readlimit - the maximum limit of bytes that can be read beforethe mark position becomes invalid. See Also: java.io.InputStream.reset since: JDK1.0 |
markSupported | public boolean markSupported()(Code) | | Tests if this input stream supports the mark
and reset methods. The markSupported
method of FilterInputStream calls the
markSupported method of its underlying input stream
and returns whatever value that method returns.
always true. since: JDK1.0 |
read | public int read() throws IOException(Code) | | Reads the next byte of data from this input stream. The value
byte is returned as an 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. This method blocks until input data
is available, the end of the stream is detected, or an exception
is thrown.
the next byte of data, or -1 if the end of thestream is reached. exception: IOException - if an I/O error occurs. See Also: java.io.FilterInputStream.in since: JDK1.0 |
read | public int read(byte b) throws IOException(Code) | | Reads up to byte.length bytes of data from this
input stream into an array of bytes. This method blocks until some
input is available.
Parameters: b - the buffer into which the data is read. the total number of bytes read into the buffer, or-1 if there is no more data because the end ofthe stream has been reached. exception: IOException - if an I/O error occurs. See Also: java.io.FilterInputStream.read(byte[]intint) since: JDK1.0 |
read | public int read(byte b, int off, int len) throws IOException(Code) | | Reads up to len bytes of data from this input stream
into an array of bytes. This method blocks until some input is
available.
Parameters: b - the buffer into which the data is read. Parameters: off - the start offset of the data. Parameters: len - the maximum number of bytes read. the total number of bytes read into the buffer, or-1 if there is no more data because the end ofthe stream has been reached. exception: IOException - if an I/O error occurs. See Also: java.io.FilterInputStream.in since: JDK1.0 |
reset | public synchronized void reset() throws IOException(Code) | | Repositions this stream to the position at the time the
mark method was last called on this input stream.
Stream marks are intended to be used in
situations where you need to read ahead a little to see what's in
the stream. Often this is most easily done by invoking some
general parser. If the stream is of the type handled by the
parser, it just chugs along happily. If the stream is not of
that type, the parser should toss an exception when it fails,
which, if it happens within readlimit bytes, allows the outer
code to reset the stream and try another parser.
exception: IOException - if this stream has not been marked or if themark has been invalidated. See Also: java.io.InputStream.mark(int) See Also: java.io.IOException since: JDK1.0 |
|
|