Ziwirila said:
"RedGrittyBrick wrote
Ziwirila wrote:
Hi,
I have a function that receives many byte[].
Is there a way to feed incrementally an InputStream with these byte
arrays ?
I would like to avoid to write to file or use a socket.
Is this what you were thinking of
http://java.sun.com/javase/6/docs/api/java/io/ByteArrayInputStream.html
I have seen it. It works perfectly with the first byte array.
Then how to append the second byte array to the input stream ?
It is not really clear what you are after. If you want to just store the
content of all your byte arrays somewhere: you need some form of
*Output*Stream. Either, you need an ByteArrayOutputStream to write your
byte arrays to if you just want to store the data somewhere. Or you want
a pair of PipedInputStream and PipedOutputStream if you want to fill your
input side from one thread and read via a different thread.