Example usage for com.liferay.portal.kernel.io.unsync UnsyncBufferedOutputStream UnsyncBufferedOutputStream

List of usage examples for com.liferay.portal.kernel.io.unsync UnsyncBufferedOutputStream UnsyncBufferedOutputStream

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.io.unsync UnsyncBufferedOutputStream UnsyncBufferedOutputStream.

Prototype

public UnsyncBufferedOutputStream(OutputStream outputStream, int size) 

Source Link

Usage

From source file:com.liferay.util.axis.SimpleHTTPSender.java

License:Open Source License

private void _writeToConnection(URLConnection urlConnection, MessageContext messageContext) throws Exception {

    urlConnection.setDoOutput(true);/*from w  ww .j  a  v  a  2  s.c  om*/

    Message message = messageContext.getRequestMessage();

    String contentType = message.getContentType(messageContext.getSOAPConstants());

    urlConnection.setRequestProperty("Content-Type", contentType);

    if (messageContext.useSOAPAction()) {
        urlConnection.setRequestProperty("SOAPAction", messageContext.getSOAPActionURI());
    }

    OutputStream outputStream = new UnsyncBufferedOutputStream(urlConnection.getOutputStream(), 8192);

    message.writeTo(outputStream);

    outputStream.flush();
}