posted 24 years ago
Which of the following can be used to create a related PipedInputStream/PipedOutputStream pair?
a. PipedInputStream pis = new PipedInputStream();
PipedOutputStream pos = new PipedOutputStream(pis);--true
b. PipedInputStream pis = new PipedInputStream();
PipedOutputStream pos = new PipedOutputStream();
pis.read(pos); -arguments are wrong
pos.write(pis);
c. PipedInputStream pis = new PipedInputStream(pos); // < -- pos is not defined
PipedOutputStream pos = new PipedOutputStream(pis);--correct
d. PipedInputStream pis = new PipedInputStream();
PipedOutputStream pos = new PipedOutputStream();
pis.connect(pos); // < --- THIS WILL CONNECT THE STREAMS
pos.connect(pis); // < --- WILL THROW IOException. Aready connected
So (a) Only.
[This message has been edited by Tony Alicea (edited February 10, 2000).]
Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD