If I have a large byte array already in memory received from a SOAP response.
I have to write this byte array into an OutputStream.
It is OK just to use write:
byte [] largeByteArray=...;
outputstream.write(largeByteArray);
...
outputstream.flush();
...
or is better to split the bytearray in small chunks and to write that to the outputstream?
If you’ve already got the large array, then just write it out – if the output stream implementation chooses to chunk it, it can make that decision. I can’t see a benefit in you doing that for it – which may well make it less efficient, if it’s able to handle large chunks.