• Post Reply Bookmark Topic Watch Topic
  • New Topic

ByteArrayInputStream to ByteArrayOutputStream

 
sangeeta kapoor
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone please let me know how can I convert ByteArrayInputStream to ByteArrayOutputStream

My scenario is something like this.

1. The getContent() method returns me the ByteArrayInputStream of the content.
2. Now I have to set this content on a new object using setContent(ByteArrayOutputStream) method. This setContent(ByteArrayOutputStream) method accepts ByteArrayOutputStream as parameter.

 
Rob Spoor
Sheriff
Posts: 20820
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Copy the contents from the ByteArrayInputStream to the ByteArrayOutputStream. See the code in http://faq.javaranch.com/java/ReadDoesntDoWhatYouThinkItDoes
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!