gzip Java/Axis Sample 2

 

    

if (null != transferEncoding &&

transferEncoding.trim().equals(HTTPConstants.HEADER_TRANSFER_ENCODING_CHUNKED)) {

  inp = new ChunkedInputStream(inp);

}

 

 

//Check the content encoding. If it is gzip then

//wrapper the input stream as a GZIPInputStream

   

 

String zip = (String)headers.get("content-encoding");

InputStream is = null;

 

if(zip.indexOf("gzip") != -1){

  GZIPInputStream zipIn = new GZIPInputStream(inp);

  is = zipIn;

} else {

        is = inp;

}      

 

//end gzip code

 

outMsg =

new Message( new SocketInputStream(is, sock), false, contentType, contentLocation);