Fabian Barney Fabian Barney - 1 year ago 89
Java Question

Chunkwise-Copy data from InputStream to OutputStream + getting byte[] at the end

I know how to copy chunkwise from an

to an

I know how to get an
from an

But how to combine them in one step? Is there an OutputStream that can be piped and buffers all written bytes so it can return a byte[] at the end?

I need something like an
but one that can be piped. (e.g. to a FileOutputStream)

Or I need something like a
which can forward to multiple OutputStreams.
Solutions using Guava and/or Apache Commons are prefered. :)

Answer Source
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download