Example usage for org.apache.commons.httpclient HttpConnection flushRequestOutputStream

List of usage examples for org.apache.commons.httpclient HttpConnection flushRequestOutputStream

Introduction

In this page you can find the example usage for org.apache.commons.httpclient HttpConnection flushRequestOutputStream.

Prototype

public void flushRequestOutputStream() throws IOException 

Source Link

Document

Flushes the output request stream.

Usage

From source file:com.gs.jrpip.client.StreamedPostMethod.java

public void reallyWriteHeaders(HttpState state, HttpConnection conn) throws IOException {
    this.writeRequestLine(state, conn);
    this.writeRequestHeaders(state, conn);
    conn.writeLine(); // close head
    // make sure the status line and headers have been sent
    conn.flushRequestOutputStream();
}

From source file:com.gs.jrpip.client.StreamedPostMethod.java

@Override
protected void writeRequest(HttpState state, HttpConnection conn) throws IOException {
    try {/*from  w  w w  .j  a  v  a2 s  .co m*/
        BufferedChunkedOutputStream bufferedChunkedOutputStream = new BufferedChunkedOutputStream(conn, state,
                this);
        this.writer.write(bufferedChunkedOutputStream);
        bufferedChunkedOutputStream.finish();
        conn.flushRequestOutputStream();
    } catch (IOException e) {
        this.cleanupConnection(conn);
        throw e;
    }
}

From source file:com.gs.jrpip.client.BufferedPostMethod.java

@Override
protected void writeRequest(HttpState state, HttpConnection conn) throws IOException {
    try {//  www  .  j a  va2  s.  c  om
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream(2048);
        this.writer.write(outputStream);
        outputStream.close();
        this.result = outputStream.toByteArray();
        this.setRequestEntity(this);

        this.writeRequestLine(state, conn);
        this.writeRequestHeaders(state, conn);
        conn.writeLine(); // close head
        // make sure the status line and headers have been sent
        conn.flushRequestOutputStream();
        this.writeRequestBody(state, conn);
        conn.flushRequestOutputStream();
    } catch (IOException e) {
        this.cleanupConnection(conn);
        throw e;
    }
}