public class DualInputStreamBuilder extends Object
DualInputStreamBuilder
class generates two
InputStream
wrapper objects for one InputStream
source.
Use this class when two independent stream operations are required for one
InputStream
source. Usually one stream is for
temporary use. For example, one stream detects the language and character
set for the input stream and another stream is used for the real purpose.
TIPS: Close either one of the InputStream
objects as soon as
the operation is completed.
Constructor and Description |
---|
DualInputStreamBuilder(InputStream in)
Constructs this object with the source
InputStream object. |
DualInputStreamBuilder(InputStream in,
int size)
Constructs this object with the source
InputStream object. |
Modifier and Type | Method and Description |
---|---|
InputStream |
getFirstInputStream()
Returns the first
InputStream object. |
InputStream |
getSecondInputStream()
Returns the second
InputStream object. |
public DualInputStreamBuilder(InputStream in, int size)
InputStream
object.in
- InputStream
objectsize
- the buffer sizepublic DualInputStreamBuilder(InputStream in)
InputStream
object.in
- InputStream
objectpublic InputStream getFirstInputStream()
InputStream
object.InputStream
objectpublic InputStream getSecondInputStream()
InputStream
object.InputStream
object