ByteArrayInputStream and ByteArrayOutputStream
I am getting the content of a source object which is returned as ByteArrayInputStream, and then I am assigning to a target object, which accepts input as ByteArrayOutputStream. Can someone please suggest as how can I convert ByteArrayInputStream to ByteArrayOutputStream, so that I can assigne it to my target object.
Here's my code:
ByteArrayInputStream content = source_object.getContent();
// how can I set the content of my source_object to the content of my target_object
target_object.setContent(<it accepts a ByteArrayOutputStream>)