|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.io.Reader
org.web3d.util.SequenceReader
Represents the logical concatenation of other readers.
The standard java.io package does not provide this capability so this
class does the same as SequenceInputStream except for
Reader derived classes.
It starts out with an ordered collection of input streams and reads from the first one until end of file is reached,whereupon it reads from the second one, and so on, until end of file is reached on the last of the contained input streams.
| Field Summary |
| Fields inherited from class java.io.Reader |
lock |
| Constructor Summary | |
SequenceReader(java.util.List readers)
Initializes a newly created SequenceReader with the list of
be a List that produces objects whose run-time type is
Reader. |
|
SequenceReader(java.io.Reader s1,
java.io.Reader s2)
Initializes a newly created SequenceReader by remembering
the two arguments, which will be read as s1 then s2 order to provide the
bytes to be read from this SequenceReader. |
|
| Method Summary | |
void |
close()
Closes this input stream and releases any system resources associated with the stream. |
int |
read()
Reads the next char of data from this input stream. |
int |
read(char[] b,
int off,
int len)
Reads up to len bytes of data from this input stream
into an array of bytes. |
| Methods inherited from class java.io.Reader |
mark, markSupported, read, ready, reset, skip |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SequenceReader(java.util.List readers)
SequenceReader with the list of
be a List that produces objects whose run-time type is
Reader. The readers that are produced by the list will
be read in order defined in the list to provide the bytes to be read from
this SequenceReader. After each input stream from the list
is exhausted, it is closed by calling its close() method.
readers - A list of input streams to processList
public SequenceReader(java.io.Reader s1,
java.io.Reader s2)
SequenceReader by remembering
the two arguments, which will be read as s1 then s2 order to provide the
bytes to be read from this SequenceReader.
s1 - The first input stream to read.s2 - The second input stream to read.| Method Detail |
public int read()
throws java.io.IOException
-1 is returned. This method blocks until input data is
available, the end of the stream is detected, or an exception is thrown.
This method tries to read one character from the current substream. If
it reaches the end of the stream, it calls the close
method of the current substream and begins reading from the next
substream.
-1 if the end of the
stream is reached.
java.io.IOException - if an I/O error occurs.
public int read(char[] b,
int off,
int len)
throws java.io.IOException
len bytes of data from this input stream
into an array of bytes. This method blocks until at least 1 byte
of input is available. If the first argument is null,
up to len bytes are read and discarded.
The read method of SequenceReader
tries to read the data from the current substream. If it fails to
read any characters because the substream has reached the end of
the stream, it calls the close method of the current
substream and begins reading from the next substream.
b - The buffer into which the data is read.off - The start offset of the data.len - The maximum number of bytes read.
java.io.IOException - if an I/O error occurs.
public void close()
throws java.io.IOException
SequenceReader
cannot perform input operations and cannot be reopened.
If this stream was created from an list, all remaining elements
are requested from the list and closed before the close
method returns. of Reader .
java.io.IOException - if an I/O error occurs.
|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||