if (httpChunkStream) {
ChunkedOutputStream chunkedOutputStream = new ChunkedOutputStream(out);
out = new BufferedOutputStream(chunkedOutputStream, Constants.HTTP_TXR_BUFFER_SIZE);
try {
if(baos != null) {
out = new TeeOutputStream(out, baos);
}
reqMessage.writeTo(out);
} catch (SOAPException e) {
log.error(Messages.getMessage("exception00"), e);
}
out.flush();
chunkedOutputStream.eos();
} else {
out = new BufferedOutputStream(out, Constants.HTTP_TXR_BUFFER_SIZE);
try {
if (!httpContinueExpected) {
out.write(header.toString()
.getBytes(HTTPConstants.HEADER_DEFAULT_CHAR_ENCODING));
}
if(baos != null) {
out = new TeeOutputStream(out, baos);
}
reqMessage.writeTo(out);
} catch (SOAPException e) {
log.error(Messages.getMessage("exception00"), e);
}