|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
java.io.SequenceInputStream
public class SequenceInputStream
SequenceInputStream is used for streaming over a sequence of streams concatenated together. Reads are taken from the first stream until it ends, then the next stream is used until the last stream returns end of file.
| Constructor Summary | |
|---|---|
SequenceInputStream(Enumeration<? extends InputStream> e)
Constructs a new SequenceInputStream using the elements returned from Enumeration e as the stream sequence. |
|
SequenceInputStream(InputStream s1,
InputStream s2)
Constructs a new SequenceInputStream using the two streams s1 and s2 as the sequence of streams to
read from. |
|
| Method Summary | |
|---|---|
int |
available()
Returns a int representing then number of bytes that are available before this InputStream will block. |
void |
close()
Close the SequenceInputStream. |
int |
read()
Reads a single byte from this SequenceInputStream and returns the result as an int. |
int |
read(byte[] buffer,
int offset,
int count)
Reads at most count bytes from this SequenceInputStream
and stores them in byte array buffer starting at
offset. |
| Methods inherited from class java.io.InputStream |
|---|
mark, markSupported, read, reset, skip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SequenceInputStream(InputStream s1,
InputStream s2)
s1 and s2 as the sequence of streams to
read from.
s1 - the first stream to get bytes froms2 - the second stream to get bytes frompublic SequenceInputStream(Enumeration<? extends InputStream> e)
e as the stream sequence. The types returned
from nextElement() must be of InputStream.
e - the Enumeration of InputStreams to get bytes from| Method Detail |
|---|
public int available()
throws IOException
available in class InputStreamIOException - If an error occurs in this InputStream.
public void close()
throws IOException
close in interface Closeableclose in class InputStreamIOException - If an error occurs attempting to close this FileInputStream.
public int read()
throws IOException
read in class InputStreamIOException - If an error occurs while reading the stream
public int read(byte[] buffer,
int offset,
int count)
throws IOException
count bytes from this SequenceInputStream
and stores them in byte array buffer starting at
offset. Answer the number of bytes actually read or -1 if
no bytes were read and end of stream was encountered.
read in class InputStreambuffer - the byte array in which to store the read bytes.offset - the offset in buffer to store the read bytes.count - the maximum number of bytes to store in buffer.
IOException - If an error occurs while reading the stream
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||