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.
| 限定符和类型 | 方法和说明 |
|---|---|
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
byteCount bytes from source and 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 在接口中 SinkIOExceptionpublic void flush()
throws IOException
Sinkflush 在接口中 Sinkflush 在接口中 FlushableIOExceptionpublic void close()
throws IOException
Sinkclose 在接口中 Sinkclose 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionCopyright © 2024. All rights reserved.