org.apache.wink.client.handlers
Interface OutputStreamAdapter


public interface OutputStreamAdapter

Interface for adapting the output stream


Method Summary
 java.io.OutputStream adapt(java.io.OutputStream os, ClientRequest request)
          This method is called in order to wrap the request output stream with another output stream to allow the manipulation of the request entity stream.
 

Method Detail

adapt

java.io.OutputStream adapt(java.io.OutputStream os,
                           ClientRequest request)
                           throws java.io.IOException
This method is called in order to wrap the request output stream with another output stream to allow the manipulation of the request entity stream. This method is called before writing the request headers to allow the adapter to manipulate the request.

For example:

 public OutputStream adapt(OutputStream os, ClientRequest request) throws IOException {
     request.getHeaders().add("Content-Encoding", "gzip");
     return new GZIPOutputStream(os);
 }
 

Parameters:
os - the current request output stream
request - the request
Returns:
the adapted request output stream
Throws:
java.io.IOException


Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.