public final class GzipSink
extends java.lang.Object
implements okio.Sink
| Constructor and Description |
|---|
GzipSink(okio.Sink sink,
int compressionLevel) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
end() |
void |
flush() |
static okhttp3.RequestBody |
gzip(okhttp3.RequestBody req,
int compressionLevel)
origin
Returns a gzip version of the RequestBody, with compressed payload.
|
okio.Timeout |
timeout() |
void |
write(okio.Buffer source,
long byteCount) |
public void write(@NotNull
okio.Buffer source,
long byteCount)
throws java.io.IOException
write in interface okio.Sinkjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface okio.Sinkjava.io.IOExceptionpublic void end()
throws java.io.IOException
java.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in interface okio.Sinkjava.io.IOException@NotNull public okio.Timeout timeout()
timeout in interface okio.Sinkpublic static okhttp3.RequestBody gzip(okhttp3.RequestBody req,
int compressionLevel)
``` val request = Request.Builder().url("...") .addHeader("Content-Encoding", "gzip") .post(uncompressedBody.gzip()) .build() ```