Code example for GZIPOutputStream

Methods: finish

0
    this.httpContent = httpContent;
    this.contentType = contentType;
  } 
 
  public void writeTo(OutputStream out) throws IOException {
    GZIPOutputStream zipper = new GZIPOutputStream(out);
    httpContent.writeTo(zipper);
    zipper.finish();
  } 
 
  public String getEncoding() {
    return "gzip"; 
  } 
 
  public long getLength() { 
    return -1; 
  } 
 
  public String getType() {
    return contentType;
  }