Code example for DeflaterOutputStream

Methods: write

0
  { 
    if (closed)
    { 
      throw new IOException("Already closed");
    } 
    deflaterOutputStream.write(b, off, len);
    crc32.update(b, off, len);
    size += len;
  } 
 
  public void close() 
      throws IOException 
  { 
    if (closed)
    { 
      // A duplicate close is just a NO-OP as with all other output streams. 
      return; 
    } 
 
    deflaterOutputStream.close();
    item.setRawData(outputStream.toByteArray(), size, crc32.getValue());