public final class GzipSink extends Object implements Sink
flush() immediately compresses all currently-buffered data;
 this early compression may be less effective than compression performed
 without flushing.
 This is equivalent to using Deflater with the sync flush option.
 This class does not offer any partial flush mechanism. For best performance,
 only call flush() when application behavior requires it.
| Modifier and Type | Method and Description | 
|---|---|
| void | close()Pushes all buffered bytes to their final destination and releases the
 resources held by this sink. | 
| Deflater | deflater()Returns the  Deflater. | 
| void | flush()Pushes all buffered bytes to their final destination. | 
| Timeout | timeout()Returns the timeout for this sink. | 
| void | write(Buffer source,
     long byteCount)Removes  byteCountbytes fromsourceand appends them to this. | 
public GzipSink(Sink sink)
public void write(Buffer source, long byteCount) throws IOException
SinkbyteCount bytes from source and appends them to this.write in interface SinkIOExceptionpublic void flush()
           throws IOException
Sinkflush in interface Flushableflush in interface SinkIOExceptionpublic Timeout timeout()
Sinkpublic void close()
           throws IOException
Sinkclose in interface Closeableclose in interface AutoCloseableclose in interface SinkIOExceptionCopyright © 2017. All rights reserved.