Quadcap Embeddable Server

com.quadcap.io.ConcatInputStream Class Reference

Inheritance diagram for com.quadcap.io.ConcatInputStream:

InputStream List of all members.

Detailed Description

This class implements an input stream which is formed by the concatenation of two or more separate input streams.

Author:
Stan Bailes

Definition at line 54 of file ConcatInputStream.java.

Public Member Functions

 ConcatInputStream (InputStream in1, InputStream in2)
 Construct a new ConcatInputStream formed by the concatenation of two input streams.

void addInputStream (InputStream in)
 Add another input stream to the concatenation.

int read () throws IOException
 Reads the next byte of data from this input stream.

int available () throws IOException
 Returns the number of bytes that can be read from this input stream without blocking.


Package Attributes

Vector streams = new Vector()
int stream = 0


Constructor & Destructor Documentation

com.quadcap.io.ConcatInputStream.ConcatInputStream InputStream  in1,
InputStream  in2
 

Construct a new ConcatInputStream formed by the concatenation of two input streams.

Parameters:
in1 the first input stream
in2 the second input stream

Definition at line 65 of file ConcatInputStream.java.

References com.quadcap.io.ConcatInputStream.streams.


Member Function Documentation

void com.quadcap.io.ConcatInputStream.addInputStream InputStream  in  ) 
 

Add another input stream to the concatenation.

Parameters:
in the input stream to add.

Definition at line 75 of file ConcatInputStream.java.

References com.quadcap.io.ConcatInputStream.addInputStream(), and com.quadcap.io.ConcatInputStream.streams.

Referenced by com.quadcap.io.ConcatInputStream.addInputStream().

int com.quadcap.io.ConcatInputStream.available  )  throws IOException
 

Returns the number of bytes that can be read from this input stream without blocking.

The available method of InputStream returns 0.

Returns:
the number of bytes that can be read from this input stream without blocking.
Exceptions:
IOException if an I/O error occurs.

Definition at line 112 of file ConcatInputStream.java.

References com.quadcap.io.ConcatInputStream.stream, and com.quadcap.io.ConcatInputStream.streams.

int com.quadcap.io.ConcatInputStream.read  )  throws IOException
 

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.

Returns:
the next byte of data, or -1 if the end of the stream is reached.
Exceptions:
IOException if an I/O error occurs.

Definition at line 93 of file ConcatInputStream.java.

References com.quadcap.io.ConcatInputStream.stream, and com.quadcap.io.ConcatInputStream.streams.


Member Data Documentation

int com.quadcap.io.ConcatInputStream.stream = 0 [package]
 

Definition at line 56 of file ConcatInputStream.java.

Referenced by com.quadcap.io.ConcatInputStream.available(), and com.quadcap.io.ConcatInputStream.read().

Vector com.quadcap.io.ConcatInputStream.streams = new Vector() [package]
 

Definition at line 55 of file ConcatInputStream.java.

Referenced by com.quadcap.io.ConcatInputStream.addInputStream(), com.quadcap.io.ConcatInputStream.available(), com.quadcap.io.ConcatInputStream.ConcatInputStream(), and com.quadcap.io.ConcatInputStream.read().