Write and rewrite data to InputStream

Hi all,

I'm trying to think of a way I could implement this but I'm not sure how.

Basically, what I want to do is place data into an InputStream to be read by another thread. I could do this with ByteArrayInputStream. The problem is that I may need to write more data to the InputStream after the object has been initialised with a byte buffer. There is no way to access the member buf because it is protected. Also, I don't know how much data may need to be written, so I'll have problems when I fill the buffer.

The Process class does something similar to what I'm trying to achieve. That is, it continually writes data to an InputStream which can be accessed by calling the getInputStream() method.

Can anyone think of a way to do this? Is there a different approach I could try?

Thanks,

Paul

[844 byte] By [paulski82a] at [2007-11-26 19:55:04]
# 1
Did you consider these? java.io.PipedOutputStreamjava.io.PipedInputStream
BIJ001a at 2007-7-9 22:47:55 > top of Java-index,Core,Core APIs...