put data in InputStream

  • Thread starter Joris Raeymaekers
  • Start date
J

Joris Raeymaekers

Hi,

Is there a way to put data (bytes) in an inputstream?
I have tried to use the Piped Input and -outputStream, to pipe the data to
the inputstream. But the method blocks when the buffer of the inputstream is
full, which I don't want.
Extending inputstream might be a solution, but is there an easier way?

Thank you for helping me,

Joris Raeymaekers
Belgium
 
C

Chris Smith

Joris said:
Is there a way to put data (bytes) in an inputstream?
I have tried to use the Piped Input and -outputStream, to pipe the data to
the inputstream. But the method blocks when the buffer of the inputstream is
full, which I don't want.
Extending inputstream might be a solution, but is there an easier way?

Try ByteArrayInputStream?

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
J

Joris Raeymaekers

Chris Smith said:
Try ByteArrayInputStream?

Ok, but then all the bytes must be given to the constructor. What if one
wants to add bytes afterwards to the stream?

Joris
 
C

Chris Smith

Joris said:
Ok, but then all the bytes must be given to the constructor. What if one
wants to add bytes afterwards to the stream?

Sorry, I'm not familiar with your exact requirements... so you basically
need a PipedInputStream/PipedOutputStream pair with a dynamically
growing buffer? I'm not aware of a simple way to accomplish that. Of
course, you could implement it yourself...

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top