How can I seek (change the position) of a ByteArrayInputStream (java.io)? It is something so obvious, but I can't seem to find a method for this anywhere (mark/reset is not enough, ...
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.
I can't imagine that there is a way to create an output stream from an input stream; however, if you create an output stream then you can copy the input stream to the output stream. You can also write a byte array directly to an OutputStream using the OutputStream.write(byte b[]) method. And I think there is a copyTo() method somewhere but ...
I am not very experienced in Java and I am having trouble converting a ByteArrayInputStream object to a FileInputStream object. There is a long story behind this so I won't waste anyone's time with it. Any hints on how to do this? I have been looking at the API but nothing jumps out that would seem to help me. It's all ...