public final class DeflaterSink 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.
Constructor and Description |
---|
DeflaterSink(Sink sink,
Deflater deflater) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Pushes all buffered bytes to their final destination and releases the
resources held by this sink.
|
void |
flush()
Pushes all buffered bytes to their final destination.
|
Timeout |
timeout()
Returns the timeout for this sink.
|
String |
toString() |
void |
write(Buffer source,
long byteCount)
Removes
byteCount bytes from source and appends them to this. |
public void write(Buffer source, long byteCount) throws IOException
Sink
byteCount
bytes from source
and appends them to this.write
in interface Sink
IOException
public void flush() throws IOException
Sink
flush
in interface Flushable
flush
in interface Sink
IOException
public void close() throws IOException
Sink
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Sink
IOException
public Timeout timeout()
Sink
Copyright © 2017. All rights reserved.